/* ============================================
   ABUNDION — MTF Styles
   Palette matches the marketing site (abundion.com).
   ============================================ */

:root {
    --bg-primary: #111113;
    --bg-secondary: #1a1a1c;
    --bg-card: #222224;
    --border: #2e2e32;
    --text-primary: #e8e8ed;
    --text-secondary: #9898a8;
    --gold: #c9a84c;
    --gold-light: #d9bc6a;
    --gold-dim: #a08a40;
    --error: #e85c5c;
    --danger: #c24545;
    --nav-height: 88px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--gold-light); }

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.3;
}
h2 {
    font-size: 1.35rem;
    letter-spacing: -0.01em;
    margin-bottom: 24px;
}
h3 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold);
    margin: 16px 0 8px;
}

/* Auth layout (login/signup) */
main.auth {
    max-width: 440px;
    margin: 0 auto;
    padding: 64px 24px;
}

.brand {
    text-align: center;
    margin-bottom: 40px;
}
.brand-logo {
    height: 80px;
    margin: 0 auto;
    opacity: 0.95;
}

/* Top nav (authenticated pages) */
nav.topbar {
    position: sticky;
    top: 0;
    height: var(--nav-height);
    background: rgba(17, 17, 19, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}
nav.topbar .nav-logo img { height: 32px; }
nav.topbar .nav-right {
    display: flex;
    gap: 20px;
    align-items: center;
}
nav.topbar .nav-right a { color: var(--text-secondary); }
nav.topbar .nav-right a:hover { color: var(--gold); }

main.app {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 24px;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 32px;
}
.card hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* Form controls */
label {
    display: block;
    margin-bottom: 18px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
label small {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    text-transform: none;
    color: var(--text-secondary);
}

input[type="email"],
input[type="password"],
input[type="text"],
select {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font: inherit;
    transition: border-color 0.15s ease;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--gold);
}

.field-row {
    display: flex;
    gap: 16px;
}

/* Subscriptions — entitled-combo list with toggles */
.sub-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}
.sub-item {
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.sub-header h3 {
    margin: 0;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
    font-size: 1.05rem;
}
.sub-controls {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 16px;
}
.sub-controls .capital {
    flex: 1;
    margin-bottom: 0;
}
.sub-controls input {
    margin-top: 6px;
}
.save-btn {
    width: auto;
    padding: 10px 18px;
    margin: 0;
}

/* iOS-style toggle switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    margin: 0;
    padding: 0;
    text-transform: none;
}
.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #3a3a42;
    border-radius: 26px;
    transition: background 0.2s ease;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}
.toggle input:checked + .toggle-slider {
    background: var(--gold);
}
.toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.inline-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.inline-edit input {
    margin: 0;
    padding: 6px 8px;
    font-size: 0.85rem;
}

.flash {
    padding: 10px 14px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--gold);
    background: rgba(201, 168, 76, 0.05);
}

button {
    width: 100%;
    padding: 13px 18px;
    background: var(--gold);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    margin-top: 8px;
    transition: background-color 0.15s ease;
}
button:hover { background: var(--gold-light); }

button.danger {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    width: auto;
    padding: 9px 18px;
    font-size: 0.85rem;
}
button.danger:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

button.link-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    padding: 0;
    width: auto;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}
button.link-button:hover { color: var(--gold); }

.inline { display: inline-block; }

/* Typography helpers */
.muted { color: var(--text-secondary); font-size: 0.9rem; }
.muted.small { font-size: 0.8rem; }
.card .muted { line-height: 1.5; }

.error {
    color: var(--error);
    padding: 10px 14px;
    border: 1px solid rgba(232, 92, 92, 0.3);
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    background: rgba(232, 92, 92, 0.05);
}

code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--gold-light);
}

p { margin-bottom: 10px; }
p + p { margin-bottom: 10px; }

/* Sessions table */
.sessions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 0.9rem;
}
.sessions-table th {
    text-align: left;
    padding: 10px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
}
.sessions-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.sessions-table tr.current {
    background: rgba(201, 168, 76, 0.04);
}
.sessions-table .tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(201, 168, 76, 0.12);
    color: var(--gold);
    border-radius: 4px;
}
button.link-button.danger-text { color: var(--error); }
button.link-button.danger-text:hover { color: #ff7b7b; }

/* 2FA QR */
.qr-box {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    margin: 20px auto;
    width: fit-content;
    max-width: 100%;
}
.qr-box svg { display: block; width: 220px; height: 220px; }

/* 6-digit code input */
input[name="code"] {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 1.5rem;
    letter-spacing: 0.4em;
    text-align: center;
}
