.profile-page { min-height: 65vh; padding: 34px 0 85px; }
.profile-page [hidden] { display: none !important; }
.profile-loading { min-height: 420px; display: grid; place-items: center; align-content: center; color: var(--muted); }
.profile-loading span { width: 34px; height: 34px; border: 2px solid var(--cream-deep); border-top-color: var(--green); border-radius: 50%; animation: profileSpin .8s linear infinite; }
.profile-loading p { margin: 12px 0 0; font-size: 11px; }
@keyframes profileSpin { to { transform: rotate(360deg); } }
.auth-layout { min-height: 620px; display: grid; grid-template-columns: 1fr minmax(420px, .78fr); overflow: hidden; background: var(--green); border-radius: 8px; box-shadow: var(--shadow-md); }
.auth-intro { position: relative; padding: clamp(55px, 7vw, 95px); color: white; background: linear-gradient(120deg, rgba(10, 27, 20, .92), rgba(10, 27, 20, .52)), url('assets/editorial/hero-bookstore-v2.png') center / cover; }
.auth-intro h1 { max-width: 620px; margin: 12px 0 23px; font-family: var(--serif); font-size: clamp(44px, 5vw, 64px); font-weight: 500; line-height: 1; }
.auth-intro > p { max-width: 520px; color: rgba(255,255,255,.75); font-size: 14px; line-height: 1.75; }
.auth-intro ul { display: grid; gap: 14px; margin: 35px 0 0; padding: 0; list-style: none; color: #eee3d3; font-size: 11px; }
.auth-intro li::before { content: '✓'; width: 22px; height: 22px; display: inline-grid; place-items: center; margin-right: 9px; color: var(--green); background: #e3c69e; border-radius: 50%; font-weight: 700; }
.auth-card { padding: clamp(35px, 5vw, 72px); background: white; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 42px; padding: 4px; background: var(--cream); border-radius: 5px; }
.auth-tabs button { min-height: 42px; background: none; border: 0; border-radius: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.auth-tabs button.active { color: var(--green); background: white; box-shadow: var(--shadow-sm); }
.account-form { display: grid; gap: 16px; }
.form-lead { margin-bottom: 8px; }
.form-lead h2, .profile-card h2, .orders-card h2 { margin: 4px 0 0; font-family: var(--serif); font-size: 27px; font-weight: 600; }
.account-form label, .password-form label { display: flex; flex-direction: column; gap: 7px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.account-form input, .account-form select, .password-form input { width: 100%; min-height: 45px; padding: 10px 12px; background: white; border: 1px solid var(--line); border-radius: 4px; outline: 0; font-size: 12px; font-weight: 400; }
.account-form input:focus, .account-form select:focus, .password-form input:focus { border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(139,99,60,.1); }
.account-name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.privacy-check { flex-direction: row !important; align-items: flex-start; color: var(--muted) !important; font-size: 8px !important; font-weight: 400 !important; }
.privacy-check input { width: 15px; min-height: 15px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--green); }
.account-message { min-height: 17px; margin: -4px 0 0; color: #8c4a3c; font-size: 9px; }
.account-message.success { color: var(--success); }
.account-heading { display: flex; justify-content: space-between; gap: 25px; align-items: flex-end; margin: 18px 0 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.account-heading h1 { margin: 5px 0 3px; font-family: var(--serif); font-size: 45px; font-weight: 500; line-height: 1; }
.account-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.profile-logout { padding: 9px 14px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 4px; font-size: 9px; font-weight: 700; }
.account-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 22px; align-items: start; }
.account-main { display: grid; gap: 22px; }
.profile-card, .orders-card { padding: 27px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.profile-card-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 24px; }
.saved-badge { padding: 5px 8px; color: #49765a; background: #edf5ef; border-radius: 20px; font-size: 7px; font-weight: 700; }
.profile-form .button { justify-self: start; }
.password-form { display: grid; grid-template-columns: minmax(200px, 1fr) auto; gap: 12px; align-items: end; }
.password-form .account-message { grid-column: 1 / -1; }
.orders-card { position: sticky; top: 180px; }
.orders-empty { padding: 42px 15px; color: var(--muted); text-align: center; }
.orders-empty span { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--cream); border-radius: 50%; font-size: 21px; }
.orders-empty strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 18px; }
.orders-empty p { margin: 5px 0 17px; font-size: 9px; }
.orders-empty .button { min-height: 39px; font-size: 9px; }
.profile-order { padding: 15px 0; border-bottom: 1px solid var(--line); }
.profile-order:last-child { border-bottom: 0; }
.order-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.order-head strong { font-size: 11px; }
.order-head span { padding: 4px 7px; color: #3e7752; background: #edf7f0; border-radius: 20px; font-size: 7px; font-weight: 700; }
.profile-order time, .profile-order small { display: block; color: var(--muted); font-size: 8px; }
.profile-order time { margin: 3px 0 10px; }
.profile-order ul { margin: 0 0 10px; padding-left: 17px; color: var(--ink-soft); font-size: 9px; }
.order-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 9px; }
.order-foot strong { font-size: 11px; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-intro { padding: 55px 45px; }
  .auth-intro h1 { font-size: 48px; }
  .auth-card { padding: 45px; }
  .account-grid { grid-template-columns: 1fr; }
  .orders-card { position: static; }
}

@media (max-width: 580px) {
  .profile-page { padding-top: 24px; }
  .auth-layout { margin-inline: -4px; }
  .auth-intro { padding: 40px 25px; }
  .auth-intro h1 { font-size: 38px; }
  .auth-card { padding: 30px 22px; }
  .auth-tabs { margin-bottom: 30px; }
  .account-name-grid, .password-form { grid-template-columns: 1fr; }
  .account-heading { align-items: flex-start; }
  .account-heading h1 { font-size: 36px; }
  .profile-card, .orders-card { padding: 22px 17px; }
  .saved-badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .profile-loading span { animation: none; }
}

/* Readability pass for account and order-management content. */
.profile-loading p, .auth-intro ul { font-size: 13px; }
.auth-intro > p { color: rgba(255,255,255,.88); font-size: 16px; }
.auth-tabs button { font-size: 13px; }
.account-form label, .password-form label { font-size: 13px; }
.account-form input, .account-form select, .password-form input { font-size: 14px; }
.privacy-check { font-size: 11px !important; }
.account-message { font-size: 12px; }
.account-heading p, .profile-logout { font-size: 12px; }
.saved-badge { font-size: 10px; }
.orders-empty p, .orders-empty .button { font-size: 12px; }
.order-head strong { font-size: 14px; }
.order-head span { font-size: 10px; }
.profile-order time, .profile-order small { font-size: 11px; }
.profile-order ul, .order-foot { font-size: 12px; }
.order-foot strong { font-size: 14px; }
