/* Account and auth pages. Loaded after style.css.
   Each page keeps its legacy-token re-theme in an inline :root block, so the
   rules below theme through var(--bg), var(--text), var(--accent) and friends. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Auth pages (accounts/base_auth.html, dark) ── */
body.auth-page {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg); color: var(--text);
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: var(--sp-5);
}
.auth-card {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); padding: var(--sp-7) var(--sp-6);
    width: 100%; max-width: 420px; box-shadow: var(--shadow);
}
.auth-logo {
    display: flex; align-items: center; gap: var(--sp-3);
    margin-bottom: var(--sp-6); justify-content: center;
}
.auth-logo svg { color: var(--accent); }
.auth-logo span { font-size: var(--fs-lg); font-weight: 700; }
.auth-title { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--sp-2); text-align: center; }
.auth-subtitle { color: var(--text-dim); font-size: var(--fs-md); text-align: center; margin-bottom: var(--sp-5); }
.form-group { margin-bottom: var(--sp-4); }
.form-group label {
    display: block; font-size: var(--fs-xs); font-weight: 600;
    color: var(--text-dim); margin-bottom: var(--sp-2); text-transform: uppercase;
    letter-spacing: 0.04em;
}
.form-group input {
    width: 100%; padding: var(--sp-3) var(--sp-4); background: var(--bg-input);
    border: 1px solid var(--fdl-border-strong); border-radius: var(--radius);
    color: var(--input-text); font-size: var(--fs-md); font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.form-group .helptext {
    font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--sp-1); line-height: 1.4;
}
.form-group .helptext ul { padding-left: var(--sp-4); }
.auth-btn {
    width: 100%; padding: var(--sp-3); background: var(--accent); color: var(--fdl-action-ink);
    border: none; border-radius: var(--radius); font-size: var(--fs-md);
    font-weight: 600; font-family: inherit; cursor: pointer;
    transition: all var(--transition); margin-top: var(--sp-2);
}
.auth-btn:hover { background: var(--accent-hover); box-shadow: var(--sh-2); }
.auth-btn-secondary {
    display: block; width: 100%; padding: var(--sp-3); margin-top: var(--sp-3);
    border: 1px solid var(--border-light); border-radius: var(--radius);
    color: var(--text); text-align: center; text-decoration: none;
    font-size: var(--fs-md); font-weight: 600; transition: all var(--transition);
}
.auth-btn-secondary:hover { background: var(--bg-raised); border-color: var(--accent); }
.auth-divider {
    display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-5) 0 var(--sp-2);
    color: var(--text-muted); font-size: var(--fs-xs); text-transform: uppercase;
    letter-spacing: 0.05em;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-footer {
    text-align: center; margin-top: var(--sp-5); font-size: var(--fs-sm); color: var(--text-dim);
}
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }
.auth-page .errorlist {
    list-style: none; padding: 0; margin: 0 0 var(--sp-4);
    background: rgba(var(--red-rgb), 0.12); border: 1px solid rgba(var(--red-rgb), 0.28);
    border-radius: var(--radius); padding: var(--sp-3) var(--sp-4);
}
.auth-page .errorlist li { color: var(--red); font-size: var(--fs-sm); line-height: 1.5; }
.auth-page .messages { list-style: none; padding: 0; margin: 0 0 var(--sp-4); }
.auth-page .messages li {
    padding: var(--sp-3) var(--sp-4); border-radius: var(--radius);
    font-size: var(--fs-sm); margin-bottom: var(--sp-2);
    background: rgba(var(--green-rgb),0.12); border: 1px solid rgba(var(--green-rgb),0.28);
    color: var(--fdl-success-bright);
}

.auth-card--wide { max-width: 760px; }

/* ── Vendor application form ── */
    .vendor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-4) var(--sp-4); }
.vendor-section { margin: var(--sp-5) 0 var(--sp-3); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.vendor-section-title { font-size: var(--fs-sm); font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--sp-3); }
.form-group textarea, .form-group select { width: 100%; padding: var(--sp-3) var(--sp-4); background: var(--bg-input); border: 1px solid var(--fdl-border-strong); border-radius: var(--radius); color: var(--input-text); font-size: var(--fs-md); font-family: inherit; }
.form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.checkbox-list { display: grid; gap: var(--sp-2); }
.checkbox-list ul,
.checkbox-list > div {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--sp-2) var(--sp-4);
}
.checkbox-list li,
.checkbox-list > div > div { min-width: 0; }
.checkbox-list label { display: flex; align-items: center; gap: var(--sp-2); text-transform: none; letter-spacing: 0; color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.35; }
.checkbox-list input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
.vendor-checks { display: grid; gap: var(--sp-3); }
.vendor-check { display: grid; grid-template-columns: 18px 1fr; gap: var(--sp-3); align-items: start; }
.vendor-check input { width: 16px; height: 16px; margin: 2px 0 0; }
.vendor-check label { text-transform: none; letter-spacing: 0; color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.4; }
.vendor-check-body { min-width: 0; }
.vendor-check-error { margin-top: var(--sp-1); color: var(--red); font-size: var(--fs-xs); line-height: 1.35; }
.field-note { color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.45; margin-top: var(--sp-1); }

/* ── Account page (accounts/account.html, light) ── */
body.account-page {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg); color: var(--text);
    min-height: 100vh;
}

/* ── Top bar ── */
.topbar {
    background: var(--fdl-surface-hero); border-bottom: 1px solid var(--fdl-border-hard);
    padding: var(--sp-4) var(--sp-5); display: flex; align-items: center;
    justify-content: space-between;
}
.topbar-brand {
    display: flex; align-items: center; gap: var(--sp-3);
    text-decoration: none; color: var(--fdl-hero-ink);
}
.topbar-brand svg { color: var(--accent); }
.topbar-brand span { font-size: var(--fs-base); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: var(--sp-3); }
.topbar-link {
    font-size: var(--fs-sm); font-weight: 500; color: var(--fdl-hero-muted);
    text-decoration: none; transition: color var(--transition);
}
.topbar-link:hover { color: var(--accent); }
.topbar-logout {
    background: none; border: none; font-family: inherit;
    font-size: var(--fs-sm); font-weight: 500; color: var(--fdl-hero-muted);
    cursor: pointer; transition: color var(--transition);
}
.topbar-logout:hover { color: var(--red); }

/* ── Page layout ── */
.account-outer {
    max-width: 1120px; margin: 0 auto;
    padding: var(--sp-6) var(--sp-5) var(--sp-7);
}
.page-title { font-size: var(--fs-xl); font-weight: 700; margin-bottom: var(--sp-2); }
.page-subtitle { font-size: var(--fs-md); color: var(--text-muted); margin-bottom: var(--sp-6); }

/* ── Two-column grid ── */
.account-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
    align-items: start;
}

/* ── Cards ── */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: var(--sp-5);
    box-shadow: var(--shadow); margin-bottom: var(--sp-5);
}
.card:last-child { margin-bottom: 0; }
.card-title {
    font-size: var(--fs-base); font-weight: 700; margin-bottom: var(--sp-4);
    display: flex; align-items: center; gap: var(--sp-2);
}
.card-title svg { color: var(--accent); flex-shrink: 0; }

/* ── Profile meta row ── */
.profile-meta {
    display: flex; gap: var(--sp-5); margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-4); border-bottom: 1px solid var(--border-light);
}
.profile-meta-item label {
    display: block; font-size: var(--fs-2xs); font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.04em; margin-bottom: 2px;
}
.profile-meta-item .value {
    font-size: var(--fs-sm); font-weight: 500; color: var(--text);
}

/* ── Form fields ── */
.form-stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-field { margin-bottom: 0; }
.form-field label {
    display: block; font-size: var(--fs-xs); font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.04em; margin-bottom: var(--sp-1);
}
.form-field input {
    width: 100%; padding: var(--sp-2) var(--sp-3); background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font-size: var(--fs-md); font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-field input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.form-field .errorlist {
    list-style: none; padding: 0; margin: var(--sp-1) 0 0;
}
.form-field .errorlist li { color: var(--red); font-size: var(--fs-xs); }
.form-actions { margin-top: var(--sp-1); }

/* ── Alerts list (card-style, no table) ── */
.alert-list { list-style: none; }
.alert-item {
    display: flex; align-items: center; gap: var(--sp-3);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-light);
}
.alert-item:last-child { border-bottom: none; }
.alert-item-img {
    flex-shrink: 0; width: 48px; height: 48px;
    border-radius: var(--r-md); overflow: hidden;
    background: var(--bg-raised); border: 1px solid var(--border-light);
}
.alert-item-img img {
    width: 100%; height: 100%; object-fit: contain;
}
.alert-item-body { flex: 1; min-width: 0; }
.alert-item-title {
    font-size: var(--fs-sm); font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.alert-item-title a {
    color: var(--accent); text-decoration: none;
}
.alert-item-title a:hover { text-decoration: underline; }
.alert-item-meta {
    font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px;
    display: flex; gap: var(--sp-3);
}
.alert-target-badge {
    font-size: var(--fs-xs); font-weight: 600; color: var(--green);
}

/* ── Inline price editing ── */
.alert-price-edit { display: inline-flex; align-items: center; }
.alert-price-display {
    font-size: var(--fs-xs); font-weight: 600; color: var(--green);
    cursor: pointer; border-bottom: 1px dashed var(--green);
    transition: color var(--transition);
}
.alert-price-display:hover { color: var(--accent); border-color: var(--accent); }
.alert-price-form {
    display: inline-flex; align-items: center; gap: var(--sp-1);
}
.alert-price-dollar {
    font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted);
}
.alert-price-input {
    width: 80px; padding: 2px var(--sp-2); font-size: var(--fs-xs);
    border: 1px solid var(--border); border-radius: var(--r-sm);
    background: var(--bg-input); color: var(--text);
    font-family: inherit;
}
.alert-price-input:focus { outline: none; border-color: var(--accent); }
.alert-price-save, .alert-price-cancel {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border: none; border-radius: var(--r-sm);
    cursor: pointer; padding: 0; transition: background var(--transition);
}
.alert-price-save {
    background: rgba(var(--green-rgb), 0.1); color: var(--green);
}
.alert-price-save:hover { background: rgba(var(--green-rgb), 0.2); }
.alert-price-cancel {
    background: rgba(var(--red-rgb), 0.08); color: var(--red);
}
.alert-price-cancel:hover { background: rgba(var(--red-rgb), 0.15); }
.alert-item-date { font-size: var(--fs-xs); color: var(--text-muted); }

.empty-state {
    text-align: center; padding: var(--sp-6) var(--sp-4);
    color: var(--text-muted); font-size: var(--fs-md);
}
.empty-state svg { color: var(--border-light); margin-bottom: var(--sp-3); }
.empty-state p { margin-bottom: var(--sp-4); }

/* ── Messages ── */
.account-page .messages { list-style: none; margin-bottom: var(--sp-5); }
.account-page .messages li {
    padding: var(--sp-3) var(--sp-4); border-radius: var(--radius);
    font-size: var(--fs-sm); margin-bottom: var(--sp-2);
    background: rgba(var(--green-rgb), 0.08); border: 1px solid rgba(var(--green-rgb), 0.2);
    color: var(--green);
}

/* ── Confirm dialog ── */
.confirm-overlay {
    display: none; position: fixed; inset: 0; z-index: var(--z-modal);
    background: rgba(var(--fdl-ink-rgb), 0.45); align-items: center; justify-content: center;
}
.confirm-overlay.active { display: flex; }
.confirm-box {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: var(--sp-6) var(--sp-5) var(--sp-5);
    box-shadow: var(--sh-3); max-width: 360px;
    width: 90%; text-align: center;
}
.confirm-box p {
    font-size: var(--fs-md); font-weight: 500; color: var(--text);
    margin-bottom: var(--sp-5); line-height: 1.5;
}
.confirm-actions { display: flex; gap: var(--sp-3); justify-content: center; }
.confirm-actions .btn { min-width: 90px; justify-content: center; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .account-outer { padding: var(--sp-5) var(--sp-4) var(--sp-7); }
    .account-columns { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .profile-meta { flex-direction: column; gap: var(--sp-3); }
}
