/* Account system pages: /account/login.html, /account/index.html,
   /account/payment-result.html, /premium/index.html and the EPS checkout
   (books/order/buy.html). Shares tokens with style.css. */

:root { --gold: #d4a017; --gold-dark: #9a6d00; --gold-soft: #fff6dc; --ok: #1f9d55; --amber: #c9860f; }

.acct-hero { background: linear-gradient(135deg, #0b4f27 0%, #124f36 60%, #1a3a2e 100%); color: #fff; text-align: center; padding: 44px 20px 40px; }
.acct-hero h1 { margin: 0 0 8px; font-size: 2rem; font-weight: 700; }
.acct-hero p { margin: 0 auto; max-width: 640px; opacity: .92; font-size: 1.02rem; line-height: 1.7; }
.acct-hero .acct-hero-kicker { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: 5px 14px; border-radius: 50px; font-size: .82rem; font-weight: 700; letter-spacing: .04em; margin-bottom: 14px; }
.acct-hero .acct-hero-kicker i { color: var(--gold); }

.acct-section { padding: 40px 0 70px; }
.acct-narrow { max-width: 520px; margin: 0 auto; padding: 0 20px; }
.acct-wide { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

.acct-card { background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.08); padding: 28px 26px; margin-bottom: 20px; }
.acct-card h2 { margin: 0 0 6px; font-size: 1.25rem; color: #1b2733; display: flex; align-items: center; gap: 10px; }
.acct-card h2 i { color: var(--deep-green); }
.acct-card .acct-sub { margin: 0 0 18px; color: var(--text-gray); font-size: .92rem; }

/* ---- Login ---- */
.acct-tabs { display: flex; background: var(--light-gray); border-radius: 50px; padding: 4px; margin-bottom: 22px; }
.acct-tabs button { flex: 1; border: none; background: none; font: inherit; font-weight: 700; padding: 10px; border-radius: 50px; cursor: pointer; color: var(--text-gray); transition: all .2s; }
.acct-tabs button.is-active { background: #fff; color: var(--deep-green); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.acct-google-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 12px 16px; border: 2px solid var(--border-gray); background: #fff; border-radius: 50px; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; transition: all .2s; color: #1b2733; }
.acct-google-btn:hover { border-color: #4285f4; box-shadow: 0 4px 14px rgba(66,133,244,.18); }
.acct-google-btn svg { width: 22px; height: 22px; }
.acct-divider { display: flex; align-items: center; gap: 12px; color: var(--text-gray); font-size: .85rem; margin: 20px 0; }
.acct-divider::before, .acct-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-gray); }
.acct-form label { display: block; font-weight: 700; font-size: .9rem; margin: 14px 0 6px; color: #1b2733; }
.acct-form input[type=text], .acct-form input[type=email], .acct-form input[type=password], .acct-form input[type=tel] { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border-gray); border-radius: 10px; font: inherit; font-size: 1rem; transition: border-color .15s; }
.acct-form input:focus { outline: none; border-color: var(--deep-green); box-shadow: 0 0 0 3px rgba(13,93,46,.12); }
.acct-pw-wrap { position: relative; }
.acct-pw-wrap input { padding-right: 46px !important; }
.acct-pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: none; background: none; color: var(--text-gray); cursor: pointer; font-size: 1rem; padding: 6px; }
.acct-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 13px 20px; border-radius: 50px; border: 2px solid var(--deep-red); background: var(--deep-red); color: #fff; font: inherit; font-weight: 700; font-size: 1.02rem; cursor: pointer; transition: all .2s; text-decoration: none; margin-top: 18px; }
.acct-btn:hover { background: #6e0000; border-color: #6e0000; }
.acct-btn:disabled { opacity: .6; cursor: default; }
.acct-btn.acct-btn-green { background: var(--deep-green); border-color: var(--deep-green); }
.acct-btn.acct-btn-green:hover { background: #0a4a24; border-color: #0a4a24; }
.acct-btn.acct-btn-outline { background: #fff; color: var(--deep-green); border-color: var(--deep-green); }
.acct-btn.acct-btn-outline:hover { background: var(--deep-green); color: #fff; }
.acct-btn.acct-btn-gold { background: var(--gold); border-color: var(--gold); color: #1b2733; }
.acct-btn.acct-btn-gold:hover { background: #b98a0f; border-color: #b98a0f; color: #fff; }
.acct-btn.acct-btn-sm { width: auto; padding: 9px 18px; font-size: .9rem; margin-top: 0; }
.acct-link-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: .88rem; }
.acct-link-row a, .acct-link-row button { color: var(--deep-green); font-weight: 600; background: none; border: none; font: inherit; cursor: pointer; padding: 0; }
.acct-link-row a:hover, .acct-link-row button:hover { text-decoration: underline; }
.acct-alert { border-radius: 10px; padding: 12px 14px; font-size: .92rem; line-height: 1.6; margin: 14px 0 0; display: flex; gap: 10px; align-items: flex-start; }
.acct-alert i { margin-top: 3px; }
.acct-alert.is-error { background: #fdecec; color: #6e0000; border: 1px solid #f3c6c6; }
.acct-alert.is-ok { background: #e6f6ec; color: #145c33; border: 1px solid #bfe3cc; }
.acct-alert.is-warn { background: #fdf3e0; color: #7a4f00; border: 1px solid #f3dfb3; }
.acct-alert.is-info { background: #eaf2ff; color: #1b3b6b; border: 1px solid #c6d9f7; }
.acct-alert button, .acct-alert a { color: inherit; font-weight: 700; background: none; border: none; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.acct-terms { font-size: .8rem; color: var(--text-gray); text-align: center; margin-top: 16px; line-height: 1.6; }
.acct-terms a { color: var(--deep-green); }
.acct-hidden { display: none !important; }

/* ---- Dashboard ---- */
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.dash-grid > div { min-width: 0; } /* wide tables scroll inside their card instead of widening the page on phones */
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-status { position: relative; overflow: hidden; border-radius: 16px; padding: 26px 24px; color: #fff; background: linear-gradient(135deg, #0b4f27, #1a3a2e); box-shadow: 0 10px 30px rgba(13,93,46,.22); margin-bottom: 20px; }
.dash-status.is-premium { background: linear-gradient(135deg, #8a6100 0%, #d4a017 55%, #f0c64d 100%); color: #1b2733; box-shadow: 0 10px 30px rgba(212,160,23,.32); }
.dash-status .dash-status-label { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.dash-status h2 { margin: 0 0 8px; font-size: 1.7rem; display: flex; align-items: center; gap: 10px; }
.dash-status p { margin: 0 0 16px; font-size: .98rem; line-height: 1.6; opacity: .95; }
.dash-status .dash-status-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-status .dash-status-meta div { font-size: .8rem; opacity: .85; }
.dash-status .dash-status-meta strong { display: block; font-size: 1.15rem; opacity: 1; }
.dash-status .acct-btn { width: auto; margin: 0; }
.dash-status .acct-btn.is-light { background: #fff; color: #0d5d2e; border-color: #fff; }
.dash-status .acct-btn.is-dark { background: #1b2733; color: #fff; border-color: #1b2733; }
.dash-status .dash-status-icon { position: absolute; right: -10px; bottom: -22px; font-size: 7rem; opacity: .12; pointer-events: none; }
.dash-profile { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.dash-profile img, .dash-profile .dash-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--deep-green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.4rem; flex-shrink: 0; }
.dash-profile strong { display: block; font-size: 1.05rem; color: #1b2733; }
.dash-profile span { font-size: .85rem; color: var(--text-gray); word-break: break-all; }
.dash-benefits { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.dash-benefits li { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; line-height: 1.55; color: #1b2733; }
.dash-benefits li i { color: var(--ok); margin-top: 4px; }
.dash-benefits li.is-off { color: var(--text-gray); }
.dash-benefits li.is-off i { color: #c4c9cf; }
.dash-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border-gray); }
.dash-toggle:first-of-type { border-top: none; }
.dash-toggle strong { display: block; font-size: .95rem; }
.dash-toggle span { font-size: .82rem; color: var(--text-gray); }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cfd5dc; border-radius: 26px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--deep-green); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.dash-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.dash-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-gray); padding: 8px 6px; border-bottom: 1px solid var(--border-gray); }
.dash-table td { padding: 10px 6px; border-bottom: 1px solid var(--border-gray); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table a { color: var(--deep-green); font-weight: 700; white-space: nowrap; }
.dash-table .mono { font-family: 'Courier New', monospace; font-size: .8rem; }
.dash-table-wrap { overflow-x: auto; }
.dash-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.dash-book { border: 1px solid var(--border-gray); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.dash-book h4 { margin: 0; font-size: .95rem; color: #1b2733; line-height: 1.4; }
.dash-book small { color: var(--text-gray); font-size: .78rem; }
.dash-book .dash-book-actions { display: flex; gap: 8px; margin-top: auto; }
.dash-book .dash-book-actions a { flex: 1; text-align: center; font-size: .82rem; font-weight: 700; padding: 8px 6px; border-radius: 50px; border: 2px solid var(--deep-green); color: var(--deep-green); text-decoration: none; }
.dash-book .dash-book-actions a.is-primary { background: var(--deep-green); color: #fff; }
.dash-empty { text-align: center; color: var(--text-gray); padding: 18px 10px; font-size: .92rem; }
.dash-empty a { color: var(--deep-green); font-weight: 700; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: .72rem; font-weight: 700; }
.badge.ok { background: #e6f6ec; color: var(--ok); }
.badge.off { background: var(--light-gray); color: var(--text-gray); }
.badge.gold { background: var(--gold-soft); color: var(--gold-dark); }
.badge.warn { background: #fdf3e0; color: var(--amber); }
.badge.err { background: #fdecec; color: #6e0000; }
.acct-loading { text-align: center; padding: 60px 20px; color: var(--text-gray); }
.acct-loading i { font-size: 2rem; color: var(--deep-green); margin-bottom: 12px; display: block; }

/* ---- Study progress (dashboard: model-test results + bookmarks) ---- */
.dash-best { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; font-size: .9rem; color: #1b2733; }
.dash-best li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.5; }
.dash-best li i { color: var(--gold); margin-top: 4px; }
.dash-chart { position: relative; height: 240px; margin: 8px 0 16px; }
.dash-table .pct { font-weight: 800; }
.dash-table .pct.ok { color: var(--ok); }
.dash-table .pct.low { color: var(--amber); }
.dash-muted { color: var(--text-gray); }
.dash-bookmarks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.dash-bookmarks li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-gray); border-radius: 10px; padding: 10px 12px; }
.dash-bookmarks li a { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: flex-start; color: #1b2733; font-weight: 600; font-size: .92rem; line-height: 1.4; text-decoration: none; }
.dash-bookmarks li a i { color: var(--deep-green); margin-top: 3px; flex-shrink: 0; }
.dash-bookmarks li a:hover span { text-decoration: underline; }
.dash-bookmarks li small { color: var(--text-gray); font-size: .76rem; white-space: nowrap; }
.dash-bookmarks li button { border: none; background: var(--light-gray); color: var(--text-gray); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; flex-shrink: 0; font-size: .9rem; }
.dash-bookmarks li button:hover { background: #fdecec; color: #8b0000; }
.dash-bookmarks li button:disabled { opacity: .5; cursor: default; }
@media (max-width: 600px) { .dash-bookmarks li { flex-wrap: wrap; } .dash-bookmarks li small { order: 3; width: 100%; padding-left: 24px; } }

/* ---- Premium pricing ---- */
.plans-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: -34px; position: relative; z-index: 2; }
@media (max-width: 992px) { .plans-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .plans-grid { grid-template-columns: 1fr; } }
.plan-card { background: #fff; border-radius: 16px; padding: 24px 20px 22px; box-shadow: 0 10px 30px rgba(0,0,0,.08); border: 2px solid transparent; display: flex; flex-direction: column; position: relative; transition: transform .15s, box-shadow .15s; }
.plan-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0,0,0,.12); }
.plan-card.is-popular { border-color: var(--deep-green); }
.plan-card.is-best { border-color: var(--gold); background: linear-gradient(180deg, #fffdf5, #fff); }
.plan-ribbon { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); padding: 4px 14px; border-radius: 50px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.plan-card.is-popular .plan-ribbon { background: var(--deep-green); color: #fff; }
.plan-card.is-best .plan-ribbon { background: var(--gold); color: #1b2733; }
.plan-name { font-size: 1.05rem; font-weight: 700; color: #1b2733; margin: 4px 0 2px; }
.plan-days { font-size: .82rem; color: var(--text-gray); margin-bottom: 14px; }
.plan-price { font-size: 2.2rem; font-weight: 900; color: var(--deep-green); line-height: 1; }
.plan-price small { font-size: 1rem; font-weight: 700; margin-right: 2px; }
.plan-card.is-best .plan-price { color: var(--gold-dark); }
.plan-per { font-size: .8rem; color: var(--text-gray); margin: 6px 0 16px; }
.plan-save { display: inline-block; background: #e6f6ec; color: #145c33; font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: 50px; margin-bottom: 12px; }
.plan-card .acct-btn { margin-top: auto; }
.benefit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 30px; }
@media (max-width: 992px) { .benefit-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .benefit-grid { grid-template-columns: 1fr; } }
.benefit { background: #fff; border-radius: 14px; padding: 22px 20px; box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.benefit i { font-size: 1.6rem; color: var(--deep-green); margin-bottom: 10px; display: block; }
.benefit h3 { margin: 0 0 6px; font-size: 1.05rem; color: #1b2733; }
.benefit p { margin: 0; font-size: .9rem; color: var(--text-gray); line-height: 1.6; }
.pay-methods { text-align: center; margin: 34px 0 0; }
.pay-methods img { max-width: 100%; height: auto; border-radius: 10px; }
.pay-methods p { font-size: .82rem; color: var(--text-gray); margin: 8px 0 0; }
.faq { margin-top: 36px; }
.faq details { background: #fff; border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.05); }
.faq summary { font-weight: 700; cursor: pointer; color: #1b2733; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.faq summary::after { content: '+'; font-size: 1.2rem; color: var(--deep-green); }
.faq details[open] summary::after { content: '−'; }
.faq p { margin: 10px 0 0; color: var(--text-gray); font-size: .92rem; line-height: 1.7; }
.plan-confirm { max-width: 560px; margin: 0 auto 24px; }
.plan-confirm .plan-confirm-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-gray); font-size: .95rem; }
.plan-confirm .plan-confirm-row:last-of-type { border-bottom: none; }
.plan-confirm .plan-confirm-row strong { color: var(--deep-green); font-size: 1.15rem; }

/* ---- Checkout (books) ---- */
.co-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--light-gray); border-radius: 12px; padding: 14px 16px; margin-bottom: 6px; }
.co-summary .co-title { font-weight: 700; color: #1b2733; line-height: 1.4; }
.co-summary .co-price { font-size: 1.35rem; font-weight: 900; color: var(--deep-green); white-space: nowrap; }
.co-badge { text-align: center; margin: 18px 0 0; }
.co-badge img { max-width: 100%; height: auto; }
.co-badge p { font-size: .78rem; color: var(--text-gray); margin: 6px 0 0; }
.co-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.co-steps li { background: var(--light-gray); border-radius: 10px; padding: 10px 8px; text-align: center; font-size: .78rem; color: #1b2733; font-weight: 600; line-height: 1.4; }
.co-steps li i { display: block; color: var(--deep-green); font-size: 1.1rem; margin-bottom: 4px; }
.order-pick-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .order-pick-list { grid-template-columns: 1fr; } }
.order-pick-item { display: flex; gap: 8px; align-items: center; padding: 9px 10px; border: 1px solid var(--border-gray); border-radius: 8px; font-size: .88rem; cursor: pointer; }
.order-pick-item.disabled { opacity: .5; cursor: not-allowed; }

/* ---- Payment result ---- */
.result-icon { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 2.4rem; }
.result-icon.ok { background: #e6f6ec; color: var(--ok); }
.result-icon.err { background: #fdecec; color: #8b0000; }
.result-icon.wait { background: #fdf3e0; color: var(--amber); }
.result-center { text-align: center; }
.result-center h2 { justify-content: center; }
.result-kv { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .92rem; }
.result-kv td { padding: 8px 4px; border-bottom: 1px solid var(--border-gray); }
.result-kv td:first-child { color: var(--text-gray); }
.result-kv td:last-child { text-align: right; font-weight: 700; color: #1b2733; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.result-actions .acct-btn { width: auto; margin: 0; }
