/* The customer account area: sign-in and the orders / courses / events page.
   Loaded per page, the same way courses.css is. */

.account-page, .account-signin {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 0 70px;
}
.account-signin { max-width: 460px; }

.account-head { margin-bottom: 26px; }
.account-head h1 { margin-bottom: 6px; }

.account-lead {
    color: var(--text-muted, #9B8FB8);
    line-height: 1.6;
    margin-bottom: 18px;
}
.account-note {
    font-size: 14px;
    color: var(--text-muted, #9B8FB8);
    margin-top: 16px;
    line-height: 1.6;
}

/* ---- Sign in ---- */
.account-form { display: flex; flex-direction: column; gap: 8px; }
.account-form label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #9B8FB8);
}
.account-form input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border, #3A2A55);
    border-radius: var(--radius, 8px);
    background: var(--card, #221338);
    color: var(--text, #E8E0F0);
    font-size: 15px;
    font-family: inherit;
}
.account-form input[type="email"]:focus {
    outline: none;
    border-color: var(--accent, #2B52DE);
}
.account-form button { margin-top: 8px; align-self: flex-start; }

/* ---- Section jump links ---- */
.account-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 34px;
    border-bottom: 1px solid var(--border, #3A2A55);
    padding-bottom: 14px;
}
.account-jump a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border: 1px solid var(--border, #3A2A55);
    border-radius: 999px;
    color: var(--text, #E8E0F0);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.account-jump a:hover { border-color: var(--gold, #D3A56E); color: var(--gold, #D3A56E); }
.account-jump a span {
    background: rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 12px;
}

/* ---- Sections and cards ---- */
.account-section { margin-bottom: 44px; scroll-margin-top: 84px; }
.account-section h2 { margin-bottom: 16px; }

.account-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.account-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--card, #221338);
    border: 1px solid var(--border, #3A2A55);
    border-radius: var(--radius, 8px);
    padding: 18px 20px;
}
.account-card-main { min-width: 40%; flex: 1 1 auto; }
.account-card-title {
    display: block;
    font-weight: 700;
    font-size: 16px;
    color: var(--text, #E8E0F0);
    text-decoration: none;
    margin-bottom: 4px;
}
a.account-card-title:hover { color: var(--gold, #D3A56E); }
.account-card-meta { font-size: 13px; color: var(--text-muted, #9B8FB8); margin: 0 0 4px; }
.account-card-items {
    font-size: 14px;
    color: var(--text, #E8E0F0);
    margin: 0;
    overflow-wrap: anywhere;
}

.account-card-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    text-align: right;
}
.account-amount { font-weight: 700; font-size: 16px; white-space: nowrap; }

/* Small button — the storefront stylesheet has .btn and .btn-outline but no
   small size, and these action buttons must not dominate the card. */
.account-card .btn-sm,
.account-page .btn-sm { padding: 6px 13px; font-size: 13px; }

/* ---- Progress bar ---- */
.account-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
    max-width: 280px;
}
.account-bar span {
    display: block;
    height: 100%;
    background: var(--gold, #D3A56E);
    border-radius: 3px;
}

/* ---- Empty states ---- */
.account-empty {
    border: 1px dashed var(--border, #3A2A55);
    border-radius: var(--radius, 8px);
    padding: 28px 22px;
    text-align: center;
    color: var(--text-muted, #9B8FB8);
}
.account-empty p { margin-bottom: 12px; }
.account-empty .btn { margin-top: 4px; }

.account-signout-line {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border, #3A2A55);
    font-size: 14px;
}

@media (max-width: 600px) {
    .account-card { flex-direction: column; align-items: stretch; gap: 12px; }
    .account-card-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; text-align: left; max-width: none; }
    .account-card-side .account-availability { flex-basis: 100%; text-align: left; }
    .account-bar { max-width: none; }
}

/* The side column (amount, View order, Upgrade, availability) can never
   squeeze the order details: capped width, and a long availability line
   wraps under the Upgrade button instead of widening the column. */
.account-card-side { flex: 0 1 auto; max-width: 300px; }
.account-card-side .account-availability {
    margin-top: 0; font-size: 12px; line-height: 1.45; text-align: right;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .account-card-side .account-availability { text-align: left; }
}

/* ---- Upgrades: a full-width row per upgradeable product, under the order ---- */
.account-card { flex-wrap: wrap; }
@media (min-width: 601px) {
    .account-card > .account-card-main { flex: 1 1 0; min-width: 0; }
}
.account-upgrades {
    flex-basis: 100%;
    list-style: none;
    margin: 4px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--border, #3A2A55);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.account-upgrade-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.account-upgrade-info { display: flex; flex-direction: column; min-width: 0; }
.account-upgrade-name { font-size: 14px; font-weight: 600; color: var(--text, #E8E0F0); }
.account-upgrade-version { font-size: 12px; color: var(--text-muted, #9B8FB8); }
.account-upgrade-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    text-align: right;
}
.account-upgrade-action .account-availability { margin: 0; font-size: 12px; }
.account-upgrade-done { font-size: 13px; color: var(--text-muted, #9B8FB8); white-space: nowrap; }
.account-upgrade-form { margin: 0; }
.account-upgrade-form .btn { white-space: nowrap; }

/* "Upgrade all": the same row, as a panel at the top of Orders */
.account-upgrade-all {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--border, #3A2A55);
    border-radius: 10px;
}

@media (max-width: 600px) {
    .account-upgrade-row { flex-direction: column; align-items: stretch; gap: 6px; }
    .account-upgrade-action { align-items: stretch; text-align: left; }
    .account-upgrade-form .btn { width: 100%; }
}
