/* /CSS/account.css
 * Stage 5 — "Manage Account" page (GDPR rights surface).
 * Mirrors the structure of pets.css / favorites.css: index.html shows the
 * account view by setting body.view-account (done by account.js when
 * window._view==='account'), which hides every other #mainContent section and
 * reveals #accountView. Reuses the CENTUO green palette throughout.
 */

/* ====================================================================
 * View switching
 * ==================================================================== */
body.view-account #mainContent > section:not(#accountView),
body.view-account #productCount,
body.view-account #pagination,
body.view-account #filterBar {
  display: none !important;
}
body.view-account #accountView {
  display: block;
}

/* The `hidden` attribute must win over the display rules below. Scoped to
   #accountView so it can't affect the rest of the site. */
#accountView [hidden] { display: none !important; }

#accountView {
  padding: 104px 24px 80px;   /* top clears the fixed nav, matches pets page */
  min-height: 50vh;
}
.account-page-inner {
  max-width: 760px;
  margin: 0 auto;
}

/* Back-to-home link */
.account-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2D6A27;
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}
.account-back:hover { color: #1A4418; transform: translateX(-2px); }
.account-back:focus-visible { outline: 2px solid #5DB852; outline-offset: 3px; border-radius: 4px; }

.account-page-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  color: #1A4418;
  margin: 0 0 28px;
  font-weight: 600;
}

/* ====================================================================
 * Loading + empty/error/signed-out states
 * ==================================================================== */
.account-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}
.account-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid #E2EDDF;
  border-top-color: #2D6A27;
  border-radius: 50%;
  animation: account-spin 0.8s linear infinite;
}
@keyframes account-spin { to { transform: rotate(360deg); } }

.account-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 72px 24px;
  background: #F7FAF6;
  border-radius: 24px;
  border: 1px solid #E2EDDF;
}
.account-state-icon { color: #5DB852; margin-bottom: 20px; opacity: 0.7; }
.account-state-text {
  font-size: 1.05rem;
  color: #3A4A38;
  max-width: 440px;
  line-height: 1.5;
  margin: 0 0 24px;
}

/* ====================================================================
 * Cards
 * ==================================================================== */
.account-card {
  background: #fff;
  border: 1px solid #E2EDDF;
  border-radius: 18px;
  padding: 24px 24px 26px;
  margin: 0 0 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.account-card-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  color: #1A4418;
  margin: 0 0 6px;
  font-weight: 600;
}
.account-card-desc {
  font-size: 0.95rem;
  color: #566554;
  line-height: 1.5;
  margin: 0 0 18px;
}

/* Profile definition list */
.account-dl {
  margin: 14px 0 0;
  display: grid;
  gap: 1px;
  background: #EEF4EC;
  border: 1px solid #EEF4EC;
  border-radius: 12px;
  overflow: hidden;
}
.account-dl > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  background: #fff;
  padding: 12px 16px;
}
.account-dl dt {
  font-size: 0.85rem;
  color: #6B7A69;
  font-weight: 600;
  margin: 0;
}
.account-dl dd {
  margin: 0;
  font-size: 0.95rem;
  color: #2A382A;
  text-align: right;
  word-break: break-word;
}

/* Counts */
.account-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.account-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 8px;
  background: #F7FAF6;
  border: 1px solid #E2EDDF;
  border-radius: 12px;
}
.account-stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2D6A27;
  font-family: Georgia, "Times New Roman", serif;
}
.account-stat-lbl { font-size: 0.8rem; color: #6B7A69; }

/* Rectification links */
.account-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.account-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  background: #F7FAF6;
  border: 1px solid #E2EDDF;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1A4418;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.account-link-btn::after { content: "→"; color: #5DB852; font-weight: 700; }
.account-link-btn:hover { background: #EEF4EC; border-color: #CFE2CA; transform: translateX(2px); }
.account-link-btn:focus-visible { outline: 2px solid #5DB852; outline-offset: 2px; }

/* ====================================================================
 * Buttons
 * ==================================================================== */
.account-btn-primary,
.account-btn-secondary,
.account-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease, border-color 0.15s ease;
}
.account-btn-primary {
  background: #2D6A27;
  color: #fff;
  box-shadow: 0 2px 6px rgba(45, 106, 39, 0.18);
}
.account-btn-primary:hover { background: #1A4418; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(45, 106, 39, 0.24); }
.account-btn-primary:active { transform: translateY(0); }
.account-btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }

.account-btn-secondary {
  background: #fff;
  color: #2D6A27;
  border: 1.5px solid #CFE2CA;
}
.account-btn-secondary:hover { background: #F7FAF6; border-color: #2D6A27; }

.account-btn-danger {
  background: #fff;
  color: #B3261E;
  border: 1.5px solid #F0C9C6;
}
.account-btn-danger:hover { background: #FCEEED; border-color: #B3261E; }
.account-btn-danger:disabled { opacity: 0.6; cursor: default; }

.account-btn-primary:focus-visible,
.account-btn-secondary:focus-visible,
.account-btn-danger:focus-visible { outline: 2px solid #5DB852; outline-offset: 2px; }

/* Export status message */
.account-msg {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: #566554;
}
.account-msg.is-error { color: #B3261E; }

/* ====================================================================
 * Data-export history
 * ==================================================================== */
.account-export-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account-export-empty {
  font-size: 0.92rem;
  color: #6B7A69;
  padding: 4px 0;
}
.account-export-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #F7FAF6;
  border: 1px solid #E2EDDF;
  border-radius: 12px;
}
.account-export-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.account-export-status {
  font-size: 0.82rem;
  font-weight: 700;
  width: fit-content;
  padding: 2px 9px;
  border-radius: 999px;
  background: #E2EDDF;
  color: #2D6A27;
}
.account-export-status.status-ready { background: #DDF1D8; color: #1A4418; }
.account-export-status.status-processing { background: #FFF3D6; color: #8A6D1F; }
.account-export-status.status-failed { background: #FCE3E1; color: #B3261E; }
.account-export-status.status-expired { background: #ECECEC; color: #6B6B6B; }
.account-export-meta { font-size: 0.82rem; color: #6B7A69; }
.account-export-dl {
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #2D6A27;
  text-decoration: none;
  padding: 7px 14px;
  border: 1.5px solid #CFE2CA;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.account-export-dl:hover { background: #EEF4EC; border-color: #2D6A27; }

/* ====================================================================
 * Danger zone + deletion banner
 * ==================================================================== */
.account-danger {
  border-color: #F0C9C6;
  background: #FFFBFB;
}
.account-danger .account-card-title { color: #B3261E; }

.account-deletion-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  margin: 0 0 20px;
  background: #FCEEED;
  border: 1px solid #F0C9C6;
  border-radius: 14px;
}
.account-deletion-banner .adb-text { min-width: 0; }
.account-deletion-banner strong { display: block; color: #B3261E; font-size: 0.98rem; margin-bottom: 2px; }
.account-deletion-banner p { margin: 0; font-size: 0.9rem; color: #7A4340; }

/* ====================================================================
 * Delete confirmation modal
 * ==================================================================== */
.account-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.account-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 18, 0.5);
}
.account-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 22px;
  padding: 28px 26px 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.account-modal-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  color: #B3261E;
  margin: 0 0 10px;
  font-weight: 600;
}
.account-modal-body { font-size: 0.95rem; color: #3A4A38; line-height: 1.55; margin: 0 0 22px; }
.account-modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Sign-out row under the deletion banner state */
.account-signout-row { margin-top: 6px; }

/* ====================================================================
 * Legal pages (Privacy Policy + Terms) — Stage 5
 * Static, indexable content. body.view-privacy / body.view-terms hides the
 * homepage sections and reveals the matching legal section. Content is
 * translated by setLang() via data-* attributes.
 * ==================================================================== */
body.view-privacy #mainContent > section:not(#privacyView),
body.view-privacy #productCount,
body.view-privacy #pagination,
body.view-privacy #filterBar,
body.view-terms #mainContent > section:not(#termsView),
body.view-terms #productCount,
body.view-terms #pagination,
body.view-terms #filterBar {
  display: none !important;
}
body.view-privacy #privacyView { display: block; }
body.view-terms #termsView { display: block; }

.legal-view {
  padding: 104px 24px 80px;
  min-height: 50vh;
}
.legal-inner {
  max-width: 760px;
  margin: 0 auto;
}
.legal-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  color: #1A4418;
  margin: 0 0 6px;
  font-weight: 600;
}
.legal-updated {
  font-size: 0.85rem;
  color: #6B7A69;
  margin: 0 0 28px;
}
.legal-inner h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  color: #1A4418;
  margin: 28px 0 8px;
  font-weight: 600;
}
.legal-inner p,
.legal-inner li {
  font-size: 0.96rem;
  color: #3A4A38;
  line-height: 1.65;
}
.legal-inner p { margin: 0 0 12px; }
.legal-inner ul { margin: 0 0 12px; padding-left: 22px; }
.legal-inner li { margin: 0 0 6px; }
.legal-inner a { color: #2D6A27; font-weight: 600; }
.legal-note {
  margin-top: 28px;
  padding: 14px 18px;
  background: #F7FAF6;
  border: 1px solid #E2EDDF;
  border-radius: 12px;
  font-size: 0.85rem;
  color: #566554;
}

/* ====================================================================
 * Responsive
 * ==================================================================== */
@media (max-width: 600px) {
  .legal-view { padding: 88px 16px 60px; }
  #accountView { padding: 88px 16px 60px; }
  .account-card { padding: 20px 18px 22px; border-radius: 16px; }
  .account-state { padding: 56px 20px; border-radius: 18px; }
  .account-counts { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .account-stat { padding: 12px 4px; }
  .account-modal-card { padding: 24px 20px 20px; border-radius: 18px; }
  .account-modal-actions { justify-content: stretch; }
  .account-modal-actions button { flex: 1; }
  .account-export-item { flex-direction: column; align-items: stretch; }
  .account-export-dl { text-align: center; }
}
