/* Dog Aunt — Client Portal Styles */
/* Reuses variables from main.css */

/* ── Top Nav ── */
.portal-nav {
  background: var(--green);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.portal-nav-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.portal-nav-logo img {
  height: 34px;
}

.portal-nav-logo span {
  font-family: 'Dog Aunt', 'Archivo Black', sans-serif;
  color: #fff;
  font-size: 20px;
  text-transform: uppercase;
}

.portal-nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.portal-nav-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all .12s;
}

.portal-nav-links a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.portal-nav-links a.act { color: #fff; background: rgba(255,255,255,0.15); }

.portal-nav-signout {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.7);
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all .12s;
}

.portal-nav-signout:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

/* Mobile hamburger */
.portal-hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 768px) {
  .portal-hamburger { display: block; }
  .portal-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--green-dk);
    flex-direction: column;
    padding: .5rem;
    gap: 2px;
  }
  .portal-nav-links.open { display: flex; }
  .portal-nav-links a { width: 100%; padding: 10px 16px; }
}

/* ── Portal Layout ── */
.portal-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

.portal-welcome {
  margin-bottom: 1.5rem;
}

.portal-welcome h1 {
  font-family: 'Dog Aunt', 'Archivo Black', sans-serif;
  font-size: 26px;
  color: var(--dark);
  margin: 0;
  text-transform: uppercase;
}

.portal-welcome p {
  color: var(--muted);
  font-size: 14px;
  margin: .25rem 0 0;
}

/* ── Cards ── */
.portal-card {
  background: var(--white);
  border: .5px solid var(--border);
  border-radius: 14px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.portal-card-head {
  padding: .85rem 1.1rem;
  border-bottom: .5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-card-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 14px;
  color: var(--dark);
}

.portal-card-body {
  padding: 1rem 1.1rem;
}

/* ── Big CTA ── */
.portal-cta {
  display: block;
  width: 100%;
  padding: 1.1rem;
  background: var(--rust);
  color: #fff !important;
  border: none;
  border-radius: 14px;
  font-family: 'Dog Aunt', 'Archivo Black', sans-serif;
  font-size: 20px;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  margin-bottom: 1.5rem;
  transition: background .12s;
  text-decoration: none;
}

.portal-cta:hover { background: var(--rust-dk); color: #fff !important; }

/* ── Warnings ── */
.portal-warning {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .65rem .85rem;
  border-bottom: .5px solid var(--border);
  font-size: 13px;
}

.portal-warning:last-child { border-bottom: none; }

.portal-warning-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.warning-urgent .portal-warning-icon { background: var(--rust-lt); color: var(--rust); }
.warning-info .portal-warning-icon { background: var(--amber-lt); color: var(--amber); }

/* ── Booking row ── */
.portal-booking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem .85rem;
  border-bottom: .5px solid var(--border);
  gap: .75rem;
}

.portal-booking-row:last-child { border-bottom: none; }

.portal-booking-info { flex: 1; }
.portal-booking-service { font-weight: 600; font-size: 13px; color: var(--dark); }
.portal-booking-detail { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Invoice row ── */
.portal-invoice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem .85rem;
  border-bottom: .5px solid var(--border);
  gap: .75rem;
}

.portal-invoice-row:last-child { border-bottom: none; }

.portal-invoice-info { flex: 1; }
.portal-invoice-desc { font-weight: 500; font-size: 13px; color: var(--dark); }
.portal-invoice-date { font-size: 11px; color: var(--muted); margin-top: 2px; }
.portal-invoice-amount { font-weight: 700; font-size: 14px; color: var(--dark); }

/* ── Dog card ── */
.portal-dog-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem;
  border-bottom: .5px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}

.portal-dog-card:last-child { border-bottom: none; }
.portal-dog-card:hover { background: var(--cream); }

.portal-dog-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--green-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.portal-dog-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.portal-dog-name { font-family: 'Dog Aunt', 'Archivo Black', sans-serif; font-size: 16px; color: var(--dark); text-transform: uppercase; }
.portal-dog-breed { font-size: 12px; color: var(--muted); }

.portal-dog-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: .25rem;
}

.portal-dog-detail {
  display: flex;
  flex-direction: column;
  padding: .45rem 0;
  border-bottom: .5px solid var(--border);
}

.portal-dog-detail-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 2px;
}

.portal-dog-detail-value {
  font-size: 13px;
  color: var(--dark);
}

/* ── Package card ── */
.portal-package {
  padding: .85rem;
  border-bottom: .5px solid var(--border);
}

.portal-package:last-child { border-bottom: none; }
.portal-package-name { font-weight: 600; font-size: 14px; color: var(--dark); }
.portal-package-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.portal-package-meta { display: flex; gap: 1rem; margin-top: .5rem; font-size: 12px; color: var(--muted); }
.portal-package-price { font-weight: 700; font-size: 16px; color: var(--green); }

/* ── Forms ── */
.portal-form-group {
  margin-bottom: .85rem;
}

.portal-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.portal-form-group input,
.portal-form-group select,
.portal-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
}

.portal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

/* ── Empty state ── */
.portal-empty {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 13px;
}

/* ── Loading spinner ── */
.portal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 13px;
}
.portal-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: portalSpin .7s linear infinite;
}
@keyframes portalSpin {
  to { transform: rotate(360deg); }
}

/* ── Login page ── */
.portal-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
}

.portal-login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 2.5rem;
  width: 380px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.portal-login-card h1 {
  font-family: 'Dog Aunt', 'Archivo Black', sans-serif;
  color: var(--green);
  margin: 0 0 .5rem;
  font-size: 28px;
  text-transform: uppercase;
}

.portal-login-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 1.5rem;
}

.portal-login-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  margin-bottom: .75rem;
  text-align: center;
}

.portal-login-btn {
  width: 100%;
  padding: 12px;
  background: var(--brown);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background .12s;
}

.portal-login-btn:hover { background: var(--brown-dk); }
.portal-login-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Modal ── */
.portal-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.portal-modal-overlay.open { display: flex; }

.portal-modal {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  width: 460px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
}

.portal-modal-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 18px;
  color: var(--dark);
  margin-bottom: 1rem;
}

.portal-modal-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  margin-top: 1.1rem;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 500px;
  width: 90%;
}

.toast {
  padding: .65rem 1rem;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  animation: toastIn .3s ease;
}

.toast.success { background: var(--green); }
.toast.error { background: var(--rust); }
.toast.info { background: var(--blue); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Mobile (phone) ── */
@media (max-width: 480px) {
  .portal-main { padding: 1rem; }

  .portal-welcome h1 { font-size: 20px; }

  /* Hamburger — bigger touch target */
  .portal-hamburger { min-width: 44px; min-height: 44px; padding: 8px; }
  .portal-nav-links.open a { padding: 12px 16px; font-size: 15px; }
  .portal-nav-signout { padding: 10px 16px; font-size: 14px; width: 100%; }

  /* CTA button */
  .portal-cta { font-size: 16px; padding: .9rem; border-radius: 12px; margin-bottom: 1rem; }

  /* Forms — prevent iOS zoom + better touch */
  .portal-form-group input,
  .portal-form-group select,
  .portal-form-group textarea {
    font-size: 16px;
    min-height: 44px;
    padding: 10px 12px;
  }

  .portal-form-row { grid-template-columns: 1fr; }

  /* Modal — full-width on mobile */
  .portal-modal {
    width: 95vw;
    max-height: 90vh;
    padding: 1.1rem;
    border-radius: 14px;
  }

  .portal-modal-title { font-size: 16px; }

  .portal-modal-actions {
    flex-direction: column;
  }
  .portal-modal-actions .btn { width: 100%; min-height: 44px; justify-content: center; }

  /* Buttons — touch friendly */
  .btn { min-height: 44px; font-size: 14px; }

  /* Toast — centered on mobile */
  .toast-container { left: 1rem; right: 1rem; top: 4rem; transform: none; width: auto; max-width: none; }
  .toast { text-align: center; }

  /* Booking rows */
  .portal-booking-row { padding: .6rem .75rem; }
  .portal-booking-service { font-size: 14px; }

  /* Invoice rows */
  .portal-invoice-row { flex-wrap: wrap; }

  /* Package meta */
  .portal-package-meta { flex-wrap: wrap; gap: .5rem; }

  /* Dog avatar */
  .portal-dog-avatar { width: 42px; height: 42px; }

  /* Dog details */
  .portal-dog-details { grid-template-columns: 1fr; }

  /* Cards */
  .portal-card { border-radius: 12px; }
  .portal-card-head { padding: .75rem .85rem; }
  .portal-card-body { padding: .85rem; }
}

/* ── Accessibility Toggle Button ── */
.portal-a11y-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.7);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all .12s;
  white-space: nowrap;
}

.portal-a11y-toggle:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

.portal-a11y-toggle.active {
  background: rgba(255,255,255,0.92);
  color: var(--green);
  border-color: transparent;
}

.portal-a11y-toggle .a11y-label { display: inline; }

@media (max-width: 768px) {
  .portal-a11y-toggle .a11y-label { display: none; }
  .portal-a11y-toggle { padding: 7px 9px; }
}

/* ── Accessible Mode Overrides ── */
html.accessible .portal-welcome h1 { font-size: 34px; }
html.accessible .portal-welcome p { font-size: 18px; }

html.accessible .portal-card-title { font-size: 18px; }
html.accessible .portal-card-body { font-size: 18px; line-height: 1.8; }
html.accessible .portal-card-body span:not(.badge):not(.member-badge):not(.dog-flag):not(.da-star),
html.accessible .portal-card-body div:not(.portal-dog-avatar):not(.portal-warning-icon):not(.dog-flags-wrap):not(.toggle-switch):not(.toggle-track),
html.accessible .portal-card-body p,
html.accessible .portal-card-body a:not(.portal-dog-card) { font-size: inherit !important; }
html.accessible .portal-card-head a { font-size: 16px; }

html.accessible .portal-booking-service { font-size: 18px; }
html.accessible .portal-booking-detail { font-size: 16px; }

html.accessible .portal-invoice-desc { font-size: 18px; }
html.accessible .portal-invoice-date { font-size: 16px; }
html.accessible .portal-invoice-amount { font-size: 19px; }

html.accessible .portal-dog-name { font-size: 20px; }
html.accessible .portal-dog-breed { font-size: 16px; }
html.accessible .portal-dog-detail-label { font-size: 14px; }
html.accessible .portal-dog-detail-value { font-size: 17px; }

html.accessible .portal-package-name { font-size: 18px; }
html.accessible .portal-package-desc { font-size: 16px; }
html.accessible .portal-package-meta { font-size: 16px; }
html.accessible .portal-package-price { font-size: 20px; }

html.accessible .portal-warning { font-size: 17px !important; line-height: 1.6; }
html.accessible .portal-warning div,
html.accessible .portal-warning span,
html.accessible .portal-warning p { font-size: 17px !important; }
html.accessible .portal-warning-icon { width: 32px; height: 32px; font-size: 16px; }
html.accessible .portal-empty { font-size: 17px; }
html.accessible .portal-loading { font-size: 17px; }

html.accessible .portal-form-group label { font-size: 15px; }
html.accessible .portal-form-group input,
html.accessible .portal-form-group select,
html.accessible .portal-form-group textarea { font-size: 18px; padding: 14px 16px; }

html.accessible .portal-modal-title { font-size: 22px; }

html.accessible .badge { font-size: 14px; padding: 4px 12px; }

html.accessible .btn { font-size: 17px; padding: 12px 22px; min-height: 50px; }
html.accessible .btn-sm { font-size: 15px; padding: 10px 16px; min-height: 46px; }

html.accessible .portal-nav-links a { font-size: 17px; padding: 10px 16px; }
html.accessible .portal-nav-signout { font-size: 16px; padding: 10px 20px; }
html.accessible .portal-a11y-toggle { font-size: 16px; }

html.accessible .portal-cta { font-size: 24px; padding: 1.4rem; }

html.accessible .text-sm { font-size: 16px; }
html.accessible .text-xs { font-size: 15px; }
html.accessible .text-muted { font-size: 16px; }

html.accessible .toggle-label { font-size: 17px; }
html.accessible .toggle-desc { font-size: 15px; }

html.accessible .toast { font-size: 17px; padding: .9rem 1.3rem; }

html.accessible .member-badge { font-size: 13px; }
html.accessible .dog-flag { font-size: 13px; }
