/* ============================================================
   BabyCo — Auth pages (login / register)
   ============================================================ */

.auth-wrap {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 20px 64px;
  background:
    radial-gradient(1200px 500px at 50% -10%, var(--bg-secondary), transparent 70%),
    var(--bg-primary);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-floating);
  padding: 40px 36px;
}

.auth-card-head {
  text-align: center;
  margin-bottom: 28px;
}

.auth-title {
  font-family: "Playfair Display", serif;
  font-size: 1.9rem;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.auth-field .req {
  color: var(--brand-secondary);
  margin-left: 2px;
}

.auth-field input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.auth-field input::placeholder {
  color: var(--text-tertiary);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(107, 172, 186, 0.18);
}

.auth-field.has-error input {
  border-color: #e0567f;
}

.auth-error {
  font-size: 0.82rem;
  color: #d23a66;
}

.auth-hint {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* Password input with show/hide button */
.auth-input-group {
  position: relative;
}

.auth-input-group input {
  padding-right: 46px;
}

.auth-toggle-pw {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-xs);
  font-size: 0.95rem;
  line-height: 1;
}

.auth-toggle-pw:hover {
  color: var(--brand-primary);
}

.auth-section-label {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-light);
  padding-top: 18px;
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: pointer;
}

.auth-checkbox input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--brand-secondary);
}

.auth-checkbox a {
  color: var(--brand-primary);
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  cursor: pointer;
}

.auth-alt {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-alt a {
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-alt a:hover {
  text-decoration: underline;
}

.auth-alert {
  background: #fdecf1;
  border: 1px solid #f3b9cd;
  color: #b32a55;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.auth-alert.is-success {
  background: #e9f6f1;
  border-color: #b6e0d0;
  color: #1f7a5a;
}

/* ============================================================
   Account page
   ============================================================ */

.account-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 120px 20px 80px;
}

.account-head {
  margin-bottom: 24px;
}

.account-head .auth-title {
  text-align: left;
}

.account-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lifted);
  padding: 28px 28px;
  margin-bottom: 24px;
  scroll-margin-top: 150px;
}

.account-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.account-card-title i {
  color: var(--brand-primary);
}

.account-empty {
  color: var(--text-tertiary);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.auth-hint-inline {
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

/* Baby rows */
.baby-row {
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 18px 14px;
  margin-bottom: 16px;
  background: var(--bg-secondary);
}

.baby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.baby-form select,
.account-card select {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.baby-form select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(107, 172, 186, 0.18);
}

.baby-due {
  margin-top: 12px;
  font-size: 0.82rem;
}

/* Size recommendation */
.size-rec {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(107, 172, 186, 0.1);
  border: 1px solid rgba(107, 172, 186, 0.28);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.size-rec-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}

.size-rec-text {
  flex: 1;
  min-width: 160px;
}

.size-rec-range {
  color: var(--text-secondary);
}

.size-rec-link {
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.size-rec-link:hover {
  text-decoration: underline;
}

.size-rec-empty {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.baby-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.baby-save {
  cursor: pointer;
}

/* Delete now sits in the actions row (normal flow), pushed to the right —
   no longer absolutely positioned over the first field on mobile. */
.baby-delete-form {
  margin-left: auto;
}

.baby-delete {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
}

.baby-delete:hover {
  color: #d23a66;
  background: rgba(210, 58, 102, 0.08);
}

.baby-add {
  margin-top: 8px;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 4px 18px;
}

.baby-add summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-primary);
  padding: 12px 0;
  list-style: none;
}

.baby-add summary::-webkit-details-marker {
  display: none;
}

.baby-add[open] summary {
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.baby-add .baby-form {
  padding-bottom: 16px;
}

.account-logout {
  text-align: center;
  margin-top: 8px;
}

.account-logout-link {
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.92rem;
}

.account-logout-link:hover {
  color: #d23a66;
}

@media (max-width: 560px) {
  .baby-grid {
    grid-template-columns: 1fr;
  }
  .account-card {
    padding: 22px 18px;
  }
}

/* Nav account chip / menu */
.nav-account {
  position: relative;
}

.nav-account-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

@media (max-width: 560px) {
  .auth-card {
    padding: 32px 22px;
  }
  .auth-title {
    font-size: 1.6rem;
  }
}

/* ============================================================
   Auth two-column split (desktop) + brand panel
   Local brand-token fallbacks in case style.css load order shifts.
   ============================================================ */

.auth-split {
  width: 100%;
  max-width: 940px;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--white, #fff);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.06));
  border-radius: var(--radius-lg, 28px);
  box-shadow: var(--shadow-floating, 0 12px 40px rgba(0, 0, 0, 0.08));
  overflow: hidden;
}

/* Inside the split, the form card drops its own chrome (the shell owns it). */
.auth-split .auth-card {
  max-width: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Brand reassurance panel — hidden on mobile (single column). */
.auth-aside {
  display: none;
}

.auth-aside-title {
  font-family: "Playfair Display", serif;
  font-size: 1.7rem;
  line-height: 1.2;
}

.auth-aside-lead {
  font-size: 1rem;
  line-height: 1.55;
  opacity: 0.94;
}

.auth-aside-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.auth-aside-list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.auth-aside-list i {
  margin-top: 2px;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.72rem;
}

@media (min-width: 880px) {
  .auth-split {
    grid-template-columns: 1.02fr 1fr;
  }
  .auth-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 48px 44px;
    color: #fff;
    background:
      radial-gradient(620px 320px at 12% 8%, rgba(255, 255, 255, 0.18), transparent 60%),
      linear-gradient(150deg,
        var(--brand-primary, #6bacba) 0%,
        #5a99a7 52%,
        var(--brand-secondary, #f199c0) 150%);
  }
  .auth-split .auth-card {
    padding: 48px 44px;
  }
}

/* Password label row + "Forgot password?" link */
.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-forgot {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-primary, #6bacba);
  text-decoration: none;
  white-space: nowrap;
}

.auth-forgot:hover {
  text-decoration: underline;
}

/* Plain-text legal agreement line (separate from marketing opt-in) */
.auth-legal {
  font-size: 0.8rem;
  color: var(--text-secondary, #5c5c5c);
  line-height: 1.5;
}

.auth-legal a {
  color: var(--brand-primary, #6bacba);
  text-decoration: underline;
}

/* Forgot-password support routing */
.auth-help-text {
  font-size: 0.92rem;
  color: var(--text-secondary, #5c5c5c);
  line-height: 1.55;
  margin-bottom: 20px;
}

.auth-support {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-support .btn {
  gap: 8px;
}

/* ============================================================
   Account — sticky in-page section nav
   ============================================================ */

.account-nav {
  position: sticky;
  top: 84px;
  z-index: 50;
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.06));
  border-radius: var(--radius-md, 18px);
  box-shadow: var(--shadow-elegant, 0 1px 2px rgba(0, 0, 0, 0.03), 0 2px 8px rgba(0, 0, 0, 0.05));
  overflow-x: auto;
}

.account-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 10px);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary, #5c5c5c);
  text-decoration: none;
  white-space: nowrap;
}

.account-nav a i {
  color: var(--brand-primary, #6bacba);
}

.account-nav a:hover {
  background: var(--bg-secondary, #fff6fb);
  color: var(--brand-primary, #6bacba);
}
