/* Signup / tier selection / account pages.
   Loaded only by the account templates via base.html's extra_css block. Uses the
   same tokens as style.css, so it follows the light/dark theme automatically.
   .form-group comes from style.css and is reused as-is for the text inputs. */

.acct-wrap {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 56px 20px 72px;
}

.acct-wrap--wide { max-width: 1040px; }

.acct-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px;
    box-shadow: 0 12px 30px var(--shadow-color);
}

.acct-card--centered { text-align: center; }

.acct-glyph {
    font: 400 38px var(--font-display);
    color: var(--accent);
    margin-bottom: 10px;
}

.acct-heading {
    font: 600 28px/1.2 var(--font-display);
    color: var(--text);
    margin: 0 0 10px;
}

.acct-heading--center,
.acct-subtitle--center { text-align: center; }

.acct-subtitle {
    font: 400 15px/1.6 var(--font-body);
    color: var(--text-muted);
    margin: 0 0 26px;
}

.acct-subtitle--center { margin-left: auto; margin-right: auto; max-width: 52ch; }

.acct-error {
    background: rgba(160, 60, 40, 0.10);
    border: 1px solid rgba(160, 60, 40, 0.30);
    color: #8c3b26;
    border-radius: 8px;
    padding: 12px 14px;
    font: 400 14px/1.5 var(--font-body);
    margin-bottom: 20px;
}

/* Country <select> — .form-group in style.css only styles input/textarea. */
.acct-card select,
.acct-wrap select {
    width: 100%;
    padding: 12px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1em;
    font-family: inherit;
}

.acct-wrap select:focus {
    outline: none;
    border-color: var(--accent);
}

.acct-btn {
    display: inline-block;
    padding: 13px 28px;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 8px;
    font: 600 15px var(--font-body);
    text-decoration: none;
    cursor: pointer;
}

.acct-btn:hover { background: var(--accent-hover); }

.acct-btn--outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.acct-btn--outline:hover { background: var(--accent); color: var(--on-accent); }

.acct-fineprint {
    margin-top: 18px;
    font: 400 13px/1.6 var(--font-body);
    color: var(--text-dim);
}

/* Quiet, in-palette links in the card's fineprint (Sign out) — without this
   they fall back to the browser's blue underline. */
.acct-fineprint a {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--border-strong);
    padding-bottom: 1px;
}

.acct-fineprint a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Tier picker -------------------------------------------------------- */

.acct-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
    align-items: stretch;   /* every card matches the tallest in the row */
}

/* The whole card is the label, so clicking anywhere selects the radio. The
   radio itself is visually hidden but kept focusable for keyboard use. */
.acct-tier { display: block; cursor: pointer; }

.acct-tier input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.acct-tier-body {
    /* Column flex so .acct-tier-note sits on the bottom edge of every card
       regardless of how many feature lines are above it. */
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 26px 22px;
    box-shadow: 0 12px 30px var(--shadow-color);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.acct-tier--featured .acct-tier-body { border: 2px solid var(--accent); }

.acct-tier input:checked + .acct-tier-body {
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 107, 58, 0.18), 0 12px 30px var(--shadow-color);
}

.acct-tier input:focus-visible + .acct-tier-body { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Plans that exist but cannot be chosen yet. Greyed rather than hidden so the
   roadmap is visible; the disabled radio is backed by a server-side check,
   since disabling an input stops nothing but the browser. */
.acct-tier--disabled { cursor: default; }

.acct-tier--disabled .acct-tier-body {
    background: var(--bg-deep);
    border: 1px dashed var(--border-strong);
    box-shadow: none;
    opacity: 0.6;
}

.acct-tier--disabled .acct-tier-name,
.acct-tier--disabled .acct-tier-price,
.acct-tier--disabled .acct-tier-price span,
.acct-tier--disabled .acct-tier-features { color: var(--text-dim); }

.acct-tier--disabled .acct-tier-note {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 11.5px;
}

.acct-tier-badge {
    position: absolute;
    top: -11px;
    left: 22px;
    background: var(--accent);
    color: var(--on-accent);
    border-radius: 999px;
    padding: 3px 11px;
    font: 600 11px var(--font-body);
}

.acct-tier-name  { display: flex; align-items: center; gap: 9px; font: 700 13px var(--font-mono); letter-spacing: 0.08em; color: var(--text-dim); }
.acct-tier--featured .acct-tier-name { color: var(--accent); }
.acct-tier-price { display: block; font: 600 34px var(--font-display); color: var(--text); margin: 8px 0 12px; }
.acct-tier-price span { font-size: 15px; color: var(--text-dim); }

.acct-tier-features { display: block; font: 400 14px/1.7 var(--font-body); color: var(--text-muted); }
.acct-tier-features span { display: block; }

.acct-tier-note {
    display: block;
    margin-top: auto;
    padding-top: 16px;
    font: 400 12.5px/1.5 var(--font-body);
    color: var(--text-dim);
}

.acct-tier-actions { text-align: center; }

/* ---- Account summary ---------------------------------------------------- */

/* ---- Profile block (merged in from the old /support/profile page) ------- */

.acct-profile {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 4px 0 26px;
}

.acct-profile-avatar img,
.acct-profile-avatar-placeholder {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

.acct-profile-avatar-placeholder {
    background: var(--accent);
    color: var(--on-accent);
    font: 600 30px/76px var(--font-display);
    text-align: center;
}

.acct-profile-username {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 600 21px var(--font-display);
    color: var(--text);
    margin: 0 0 4px;
}

.acct-profile-admin {
    background: var(--accent);
    color: var(--on-accent);
    border-radius: 999px;
    padding: 2px 9px;
    font: 600 10.5px var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.acct-profile-joined {
    font: 400 13.5px var(--font-body);
    color: var(--text-dim);
    margin: 0 0 6px;
}

.acct-profile-stats {
    display: flex;
    gap: 16px;
    font: 400 13.5px var(--font-body);
    color: var(--text-muted);
}

.acct-profile-stats strong { color: var(--text); font-weight: 600; }

.acct-about { margin: 0 0 24px; }

.acct-section-heading {
    font: 600 13px var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 0 0 8px;
}

.acct-about .rich-content,
.acct-about .rich-content p {
    font: 400 15px/1.7 var(--font-body);
    color: var(--text-muted);
    margin: 0 0 10px;
}

.acct-about .rich-content a { color: var(--accent); }
.acct-about .rich-content img { max-width: 100%; border-radius: 8px; margin: 10px 0; }

.acct-profile-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin: 0 0 26px;
}

.acct-link-quiet {
    font: 400 13.5px var(--font-body);
    color: var(--text-dim);
}

.acct-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 10px 20px;
    margin: 0 0 28px;
    font: 400 15px var(--font-body);
}

.acct-details dt { color: var(--text-dim); }
.acct-details dd { margin: 0; color: var(--text); }

.acct-plan {
    border-top: 1px solid var(--border);
    padding-top: 22px;
}

.acct-plan-head { display: flex; align-items: baseline; gap: 12px; }
.acct-plan-name  { font: 700 13px var(--font-mono); letter-spacing: 0.08em; color: var(--accent); }
.acct-plan-price { font: 600 26px var(--font-display); color: var(--text); }
.acct-plan-price span { font-size: 14px; color: var(--text-dim); }

.acct-plan-active  { font: 600 13px var(--font-body); color: var(--accent); margin: 6px 0 14px; }
.acct-plan-pending { font: 400 13.5px/1.6 var(--font-body); color: var(--text-dim); margin: 6px 0 14px; }

.acct-plan-features {
    margin: 0 0 20px;
    padding-left: 20px;
    font: 400 14px/1.75 var(--font-body);
    color: var(--text-muted);
}

/* ---- Page credits ------------------------------------------------------- */

.acct-credits {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0 22px;
    padding: 14px 16px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
}

.acct-credits-count {
    font: 600 30px/1 var(--font-display);
    color: var(--accent);
}

.acct-credits-label {
    display: flex;
    flex-direction: column;
    font: 600 14px var(--font-body);
    color: var(--text);
}

.acct-credits-note {
    font: 400 12.5px/1.5 var(--font-body);
    color: var(--text-dim);
}

/* Nothing left to spend: drop the accent so it reads as spent, not available. */
.acct-credits--empty { border-left-color: var(--border-strong); }
.acct-credits--empty .acct-credits-count { color: var(--text-dim); }

@media (max-width: 860px) {
    .acct-tiers { grid-template-columns: 1fr; gap: 26px; }
    .acct-profile { gap: 14px; }
    .acct-profile-avatar img,
    .acct-profile-avatar-placeholder { width: 60px; height: 60px; }
    .acct-profile-avatar-placeholder { font-size: 24px; line-height: 60px; }
    .acct-wrap  { padding: 36px 16px 56px; }
    .acct-card  { padding: 26px 20px; }
}

/* ---- Processing page ---------------------------------------------------- */

.proc-truncated { color: var(--text-dim); font-size: 13px; }

.proc-imported {
    max-width: 560px;
    margin: 0 auto 28px;
    text-align: center;
    background: rgba(79, 107, 58, 0.10);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 8px;
    padding: 12px 16px;
    font: 600 14px var(--font-body);
}

.proc-hint {
    text-align: center;
    font: 400 14px var(--font-body);
    color: var(--text-muted);
    margin: 0 0 20px;
}

.proc-pages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.proc-page { margin: 0; text-align: center; display: block; cursor: pointer; }

/* The checkbox holds the state; it stays focusable but out of sight, and the
   thumbnail beside it is what gets the selected ring. */
.proc-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.proc-page-body { display: block; }

/* White plate behind every page: a MusicXML render is a transparent SVG and
   would be unreadable on the cream background, and in dark mode entirely. */
.proc-page img {
    width: 100%;
    display: block;
    background: #ffffff;
    border: 2px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: border-color 0.12s, box-shadow 0.12s;
}

.proc-page:hover img { border-color: var(--border-strong); }

.proc-check:checked + .proc-page-body img {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 107, 58, 0.22), 0 4px 12px var(--shadow-color);
}

.proc-check:focus-visible + .proc-page-body img {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.proc-page figcaption,
.proc-page-num {
    display: block;
    margin-top: 7px;
    font: 400 12px var(--font-body);
    color: var(--text-dim);
}

.proc-check:checked + .proc-page-body .proc-page-num {
    color: var(--accent);
    font-weight: 600;
}

/* Already-imported pages on the read-only view. */
.proc-page.is-imported img { border-color: var(--accent); }

.acct-btn:disabled {
    background: var(--border-strong);
    color: var(--surface);
    cursor: not-allowed;
}

.acct-btn:disabled:hover { background: var(--border-strong); }

.proc-actions { text-align: center; }
.proc-done {
    display: block;
    margin-bottom: 14px;
    font: 600 15px var(--font-body);
    color: var(--accent);
}

/* ---- Landing-page drop zone states -------------------------------------- */

.lp-dropzone.is-dragover {
    border-color: var(--accent);
    background: rgba(79, 107, 58, 0.06);
}

.lp-dropzone.is-busy { opacity: 0.7; }

.lp-dropzone-status {
    margin-top: 12px;
    font: 400 13px/1.5 var(--font-body);
    color: var(--text-dim);
    min-height: 1.2em;
}

.lp-dropzone-status.is-error { color: #8c3b26; }
