/* ── Account pages shared styles ─────────────────────────────── */

/* Scoped design tokens — keeps magic numbers in one place */
:root {
  --ap-text-secondary: #5a6672;
  --ap-text-muted: #8a9198;
  --ap-shadow-sm: rgba(24, 32, 27, 0.04);
  --ap-shadow-lg: rgba(24, 32, 27, 0.08);
}

body.dark-mode {
  --ap-text-secondary: #9E9189;   /* warm neutral — no green cast */
  --ap-text-muted: #756D65;       /* warm neutral muted */
  --ap-shadow-sm: rgba(0, 0, 0, 0.14);
  --ap-shadow-lg: rgba(0, 0, 0, 0.30);
}

/* Entry animation */
@keyframes ap-enter {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.account-page {
  max-width: 960px;
  margin: 3rem auto 5rem;
  padding: 0 1.25rem;
  animation: ap-enter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.account-page--narrow {
  max-width: 760px;
}

/* ── Header ───────────────────────────────────────────────────── */
.account-page__header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(30, 61, 47, 0.10);
}

.account-page__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-color, #B87318);
}

.account-page__eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--blue-color, #B87318);
  border-radius: 2px;
}

.account-page h1 {
  margin: 0 0 0.5rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--font-color, #18201B);
  letter-spacing: -0.01em;
}

.account-page__intro {
  max-width: 52ch;
  margin: 0;
  font-size: 0.97rem;
  color: var(--ap-text-secondary);
  line-height: 1.65;
}

/* ── Alert ────────────────────────────────────────────────────── */
.account-page__alert {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  border-left: 3px solid var(--green-color, #3A7048);
  background: #edf7f0;
  color: #16351f;
  font-size: 0.92rem;
  font-weight: 500;
  animation: ap-enter 0.3s ease both;
}

.account-page__alert::before {
  content: 'check_circle';
  font-family: 'Material Symbols Outlined';
  font-size: 1.15rem;
  color: var(--green-color, #3A7048);
  flex-shrink: 0;
}

/* ── Grid & Card ──────────────────────────────────────────────── */
.account-card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.account-form {
  display: grid;
  gap: 1.25rem;
}

.account-card {
  position: relative;
  padding: 1.75rem;
  border: 1px solid rgba(30, 61, 47, 0.11);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 6px var(--ap-shadow-sm),
              0 16px 40px var(--ap-shadow-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.account-card:hover {
  box-shadow: 0 4px 8px var(--ap-shadow-sm),
              0 22px 52px var(--ap-shadow-lg);
  transform: translateY(-1px);
}

/* top accent bar */
.account-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple-color, #1E3D2F) 0%, var(--blue-color, #B87318) 100%);
  border-radius: 20px 20px 0 0;
}

.account-card > h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.85rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--font-color, #18201B);
}

.account-card h2 .material-symbols-outlined {
  font-size: 1.2rem;
  color: var(--purple-color, #1E3D2F);
  opacity: 0.7;
}

.account-card p {
  margin: 0 0 0.75rem;
  font-size: 0.93rem;
  color: var(--ap-text-secondary);
  line-height: 1.65;
}

.account-card p:last-child {
  margin-bottom: 0;
}

.account-page__muted {
  font-size: 0.88rem;
  color: var(--ap-text-muted);
  font-style: italic;
}

/* ── Profile: avatar ──────────────────────────────────────────── */
.account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-color, #1E3D2F) 0%, #2d5c42 100%);
  color: #fff;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  user-select: none;
  flex-shrink: 0;
}

/* ── Profile: detail rows ─────────────────────────────────────── */
.account-card__details {
  display: grid;
  gap: 0;
  margin: 0;
}

.account-card__details > div {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(30, 61, 47, 0.07);
}

.account-card__details > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.account-card__details > div:first-child {
  padding-top: 0;
}

.account-card__detail-icon {
  font-family: 'Material Symbols Outlined';
  font-size: 1rem;
  color: var(--purple-color, #1E3D2F);
  opacity: 0.5;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1em;
}

.account-card__detail-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.account-card__details dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a9198;
}

.account-card__details dd {
  margin: 0;
  font-size: 0.97rem;
  color: var(--font-color, #18201B);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Settings: choice tiles ───────────────────────────────────── */
.account-choices {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.account-choices--2col {
  grid-template-columns: 1fr 1fr;
}

.account-choice-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1.1rem 0.75rem;
  border: 2px solid rgba(30, 61, 47, 0.13);
  border-radius: 14px;
  background: var(--main-auxiliary, #E8E3D8);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
  user-select: none;
}

.account-choice-tile:hover {
  border-color: rgba(30, 61, 47, 0.35);
  background: rgba(30, 61, 47, 0.05);
}

.account-choice-tile:has(input:checked) {
  border-color: var(--purple-color, #1E3D2F);
  background: rgba(30, 61, 47, 0.07);
  box-shadow: 0 0 0 1px var(--purple-color, #1E3D2F);
}

/* visually hidden radio but still accessible */
.account-choice-tile input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.account-choice-tile .material-symbols-outlined {
  font-size: 1.5rem;
  color: var(--purple-color, #1E3D2F);
  transition: color 0.18s;
}

.account-choice-tile:has(input:checked) .material-symbols-outlined {
  color: var(--purple-color, #1E3D2F);
}

.account-choice-tile__flag {
  font-size: 1.6rem;
  line-height: 1;
}

.account-choice-tile__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--font-color, #18201B);
}

.account-choice-tile__check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(30, 61, 47, 0.2);
  transition: all 0.18s;
  margin-top: 0.2rem;
}

.account-choice-tile:has(input:checked) .account-choice-tile__check {
  background: var(--purple-color, #1E3D2F);
  border-color: var(--purple-color, #1E3D2F);
}

.account-choice-tile:has(input:checked) .account-choice-tile__check::after {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

/* ── Privacy: section layout ──────────────────────────────────── */
.account-card--stacked {
  display: grid;
  gap: 0;
}

.privacy-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(30, 61, 47, 0.08);
}

.privacy-section:first-child {
  padding-top: 0;
}

.privacy-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.privacy-section__header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.privacy-section__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--purple-color, #1E3D2F);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.privacy-section h2 {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--font-color, #18201B);
}

.privacy-section p {
  margin: 0 0 0.6rem;
  font-size: 0.93rem;
  color: var(--ap-text-secondary);
  line-height: 1.7;
}

.privacy-section p:last-child {
  margin-bottom: 0;
}

.privacy-section ul {
  margin: 0.4rem 0 0.6rem 0;
  padding-left: 1.25rem;
}

.privacy-section ul li {
  font-size: 0.93rem;
  color: var(--ap-text-secondary);
  line-height: 1.65;
  margin-bottom: 0.3rem;
}

.privacy-meta {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(30, 61, 47, 0.08);
  font-size: 0.8rem;
  color: var(--ap-text-muted);
  font-style: italic;
}

/* ── Button ───────────────────────────────────────────────────── */
.account-page__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: fit-content;
  min-width: 180px;
  margin-top: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--purple-color, #1E3D2F);
  color: var(--font-color-contrast, #F4F1EB);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
  box-shadow: 0 2px 8px rgba(30, 61, 47, 0.25);
}

.account-page__button:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(30, 61, 47, 0.32);
}

.account-page__button:active {
  transform: translateY(0);
}

.account-page__button:focus-visible {
  outline: 3px solid var(--blue-color, #B87318);
  outline-offset: 3px;
}

.account-choice-tile:focus-within {
  outline: 3px solid var(--blue-color, #B87318);
  outline-offset: 2px;
  border-radius: 14px;
}

/* ── Dark mode ────────────────────────────────────────────────── */
body.dark-mode .account-page__header {
  border-bottom-color: rgba(159, 209, 189, 0.12);
}

body.dark-mode .account-page__eyebrow {
  color: var(--blue-color, #D4921C);
}

body.dark-mode .account-page__eyebrow::before {
  background: var(--blue-color, #D4921C);
}

body.dark-mode .account-page h1 {
  color: #f0f4f2;
}

body.dark-mode .account-page__intro {
  color: #95a5a8;
}

body.dark-mode .account-card {
  background: rgba(18, 26, 22, 0.95);
  border-color: rgba(159, 209, 189, 0.13);
  box-shadow: 0 4px 6px rgba(0,0,0,0.12),
              0 16px 40px rgba(0,0,0,0.28);
}

body.dark-mode .account-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.18),
              0 20px 50px rgba(0,0,0,0.35);
}

body.dark-mode .account-card legend,
body.dark-mode .account-card > h2 {
  color: #e8f0ec;
}

body.dark-mode .account-card .material-symbols-outlined {
  color: var(--purple-color, #3E7055);
}

body.dark-mode .account-card p {
  color: #8fa89c;
}

body.dark-mode .account-card__details > div {
  border-bottom-color: rgba(159, 209, 189, 0.08);
}

body.dark-mode .account-card__detail-icon {
  color: var(--purple-color, #3E7055);
}

body.dark-mode .account-card__details dt {
  color: #6b7e76;
}

body.dark-mode .account-card__details dd {
  color: #dde8e3;
}

body.dark-mode .account-page__alert {
  background: rgba(40, 70, 52, 0.6);
  border-left-color: #4d9463;
  color: #c6e8d2;
}

body.dark-mode .account-page__alert::before {
  color: #4d9463;
}

body.dark-mode .account-page__muted {
  color: #6b7e76;
}

body.dark-mode .account-choice-tile {
  border-color: rgba(159, 209, 189, 0.16);
  background: rgba(30, 50, 40, 0.5);
}

body.dark-mode .account-choice-tile:hover {
  border-color: rgba(159, 209, 189, 0.4);
  background: rgba(30, 50, 40, 0.75);
}

body.dark-mode .account-choice-tile:has(input:checked) {
  border-color: var(--purple-color, #3E7055);
  background: rgba(62, 112, 85, 0.18);
  box-shadow: 0 0 0 1px var(--purple-color, #3E7055);
}

body.dark-mode .account-choice-tile .material-symbols-outlined {
  color: #9fd1bd;
  opacity: 1;
}

body.dark-mode .account-choice-tile__label {
  color: #dde8e3;
}

body.dark-mode .account-choice-tile__check {
  border-color: rgba(159, 209, 189, 0.3);
}

body.dark-mode .account-choice-tile:has(input:checked) .account-choice-tile__check {
  background: var(--purple-color, #3E7055);
  border-color: var(--purple-color, #3E7055);
}

body.dark-mode .privacy-section {
  border-bottom-color: rgba(159, 209, 189, 0.08);
}

body.dark-mode .privacy-section h2 {
  color: #e8f0ec;
}

body.dark-mode .privacy-section p,
body.dark-mode .privacy-section ul li {
  color: #8fa89c;
}

body.dark-mode .privacy-meta {
  color: #5a6e66;
  border-top-color: rgba(159, 209, 189, 0.08);
}

body.dark-mode .account-avatar {
  background: linear-gradient(135deg, var(--purple-color, #3E7055) 0%, #2a5040 100%);
}
