/* ========================================================================
   Octanist admin, settings page
   ======================================================================== */

.octanist-wrap {
  max-width: 780px;
  margin-top: 10px;
}

.octanist-wrap * {
  box-sizing: border-box;
}

/* ----- Header ---------------------------------------------------------- */

.octanist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 4px;
}

.octanist-header__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.octanist-header__logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}

.octanist-header__text { min-width: 0; }

.octanist-header__title {
  margin: 0;
  padding: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
  color: #0f172a;
}

.octanist-header__tagline {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}

/* Hide the WP <hr class="wp-header-end"> divider, it's just a marker for
   where admin_notices should be injected. */
.octanist-wrap > .wp-header-end {
  border: 0;
  margin: 0;
  height: 0;
}

/* ----- Status pill ----------------------------------------------------- */

.octanist-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}

.octanist-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.octanist-status.is-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.octanist-status.is-warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

/* ----- Admin notices (WP-injected) ------------------------------------- */

.octanist-wrap .notice,
.octanist-wrap div.updated,
.octanist-wrap div.error {
  margin: 12px 0 16px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ----- Cards ----------------------------------------------------------- */

.octanist-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin: 16px 0 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.octanist-card--muted {
  background: #fafbfc;
}

.octanist-card__head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.octanist-card__title {
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.octanist-card__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.octanist-card__body {
  padding: 18px 22px 20px;
}

/* ----- Inputs ---------------------------------------------------------- */

.octanist-input {
  display: block;
  width: 100%;
  max-width: 360px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.octanist-input:focus {
  border-color: #3f6967;
  box-shadow: 0 0 0 3px rgba(63, 105, 103, 0.15);
  outline: none;
}

select.octanist-input {
  font-family: inherit;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%2364748b' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
}

.octanist-input--wide {
  max-width: 520px;
}

.octanist-help {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

/* ----- Fields --------------------------------------------------------- */

.octanist-field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.octanist-field + .octanist-field {
  margin-top: 18px;
}

.octanist-field__label {
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

/* ----- Current settings summary -------------------------------------- */

.octanist-connected-panel {
  padding: 18px;
  border: 1px solid rgba(63, 105, 103, 0.16);
  border-radius: 10px;
  background: linear-gradient(180deg, #f7fbfa 0%, #fff 62%);
}

.octanist-connected-panel__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 18px;
}

.octanist-connected-panel__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  flex-shrink: 0;
}

.octanist-connected-panel__mark span {
  display: block;
  width: 12px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translate(1px, -1px);
}

.octanist-connected-panel__copy {
  min-width: 0;
}

.octanist-connected-panel__copy h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.octanist-connected-panel__copy p {
  max-width: 58ch;
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.octanist-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.octanist-summary-tile {
  min-width: 0;
  padding: 0 18px;
  border-left: 1px solid rgba(15, 23, 42, 0.08);
}

.octanist-summary-tile:first-child {
  padding-left: 0;
  border-left: 0;
}

.octanist-summary-tile:last-child {
  padding-right: 0;
}

.octanist-summary-tile dt,
.octanist-summary-tile dd {
  margin: 0;
}

.octanist-summary-tile dt {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.octanist-summary-tile dd {
  margin-top: 7px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.octanist-summary-tile dd code {
  display: inline-block;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.78);
  color: #0f172a;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.octanist-summary-tile span {
  display: block;
  margin-top: 7px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.octanist-settings-edit {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

/* ----- Collapsible setting groups ------------------------------------ */

.octanist-disclosure {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.octanist-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  color: #0f172a;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.octanist-disclosure summary::-webkit-details-marker {
  display: none;
}

.octanist-disclosure summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.octanist-disclosure[open] summary {
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}

.octanist-disclosure[open] summary::after {
  transform: rotate(225deg);
}

.octanist-disclosure__body {
  padding: 18px 16px 20px;
  background: #fff;
}

/* ----- Radio option cards --------------------------------------------- */

.octanist-options {
  display: grid;
  gap: 10px;
}

.octanist-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.octanist-option:hover {
  border-color: #cbd5e1;
  background: #fafbfc;
}

.octanist-option.is-active {
  border-color: #3f6967;
  background: #f5faf9;
  box-shadow: 0 0 0 3px rgba(63, 105, 103, 0.08);
}

.octanist-option input[type="radio"] {
  margin: 3px 0 0 0;
  flex-shrink: 0;
  accent-color: #3f6967;
}

.octanist-option__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.octanist-option__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.octanist-option__desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

/* ----- Badge ---------------------------------------------------------- */

.octanist-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.octanist-badge--success {
  margin-top: 1px;
  padding: 4px 10px;
  background: #ecfdf5;
}

/* ----- Actions (save button) ----------------------------------------- */

.octanist-actions {
  padding: 18px 0 4px;
}

#octanist-settings-page .button-primary,
#octanist-settings-page .button-primary.button-large {
  background: #3f6967;
  border-color: #3f6967;
  border-radius: 6px;
  padding: 6px 18px;
  height: auto;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(63, 105, 103, 0.15);
  text-shadow: none;
}

#octanist-settings-page .button-primary:hover,
#octanist-settings-page .button-primary:focus {
  background: #335755;
  border-color: #335755;
  box-shadow: 0 0 0 3px rgba(63, 105, 103, 0.2);
}

/* ----- Health list ---------------------------------------------------- */

.octanist-health {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.octanist-health__row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.octanist-health__row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.octanist-health dt {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.octanist-health dd {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
}

.octanist-health__error {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 12px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ----- Small screens -------------------------------------------------- */

@media (max-width: 640px) {
  .octanist-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .octanist-connected-panel {
    padding: 16px;
  }

  .octanist-connected-panel__head {
    grid-template-columns: auto 1fr;
    padding-bottom: 16px;
  }

  .octanist-connected-panel__head .octanist-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .octanist-summary-grid {
    grid-template-columns: 1fr;
    padding-top: 0;
    border-top: 0;
  }

  .octanist-summary-tile {
    padding: 14px 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    border-left: 0;
  }

  .octanist-summary-tile:first-child {
    padding-top: 16px;
  }

  .octanist-summary-tile:last-child {
    padding-bottom: 0;
  }

  .octanist-health__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
