/* BatchProcess Server: accounts and licensing for BatchProcess 3 */

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

:root {
    --bp-bg: #0d1117;
    --bp-surface: #161b22;
    --bp-border: #21262d;
    --bp-border-strong: #30363d;
    --bp-success: #3fb950;
    --bp-text-dim: #484f58;
    --bp-link: #58a6ff;
    --bp-text-muted: #8b949e;
    --bp-text: #d1d5db;
    --bp-text-bright: #f0f6fc;
    --bp-danger: #f85149;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bp-bg);
    color: var(--bp-text);
    font-size: 15px;
    line-height: 1.6;
    /* The layout owner: an exact-height flex column that main fills, so no page needs to know the
       nav's rendered height (the old calc(100vh - 56px) did, and nothing checked it stayed 56). */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

a { text-decoration: none; color: inherit; }

/* Nav */
.cp-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    height: 56px;
    border-bottom: 1px solid var(--bp-surface);
    position: sticky;
    top: 0;
    background: rgba(13,17,23,0.92);
    backdrop-filter: blur(8px);
    z-index: 10;
}

.nav-logo { font-size: 15px; font-weight: 600; color: var(--bp-text-bright); letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 8px; align-items: center; }

.btn-ghost {
    background: none;
    border: none;
    font: inherit;
    font-size: 13px;
    color: var(--bp-text-muted);
    cursor: pointer;
    padding: 7px 14px;
    border-radius: 6px;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-ghost:hover { color: var(--bp-text-bright); background: var(--bp-surface); }

.btn-cta {
    background: var(--bp-text-bright);
    color: var(--bp-bg);
    border: none;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-cta:hover { opacity: 0.88; color: var(--bp-bg); }

/* Notice bar */
.notice {
    background: var(--bp-bg);
    border-bottom: 1px solid var(--bp-surface);
    padding: 9px 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}
.notice-inner { display: flex; align-items: center; gap: 10px; }
.n-badge {
    background: #6e4f00;
    color: #e3b341;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 100px;
    letter-spacing: 0.04em;
}
.notice p { font-size: 12px; color: var(--bp-text-muted); }
.notice a { font-size: 12px; color: var(--bp-link); text-decoration: none; }
.notice a:hover { text-decoration: underline; }

/* Hero */
.hero { padding: 80px 48px 0; max-width: 1060px; margin: 0 auto; text-align: center; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 12px;
    color: var(--bp-text-muted);
    margin-bottom: 28px;
}
.hero-eyebrow span { color: var(--bp-link); font-weight: 500; }

.hero h1 {
    font-size: clamp(38px, 5vw, 60px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--bp-text-bright);
    margin-bottom: 20px;
}

.hero p { font-size: 16px; color: var(--bp-text-muted); max-width: 500px; margin: 0 auto 36px; line-height: 1.7; }

.hero-cta { display: flex; gap: 12px; justify-content: center; align-items: center; margin-bottom: 64px; flex-wrap: wrap; }

.btn-cta-lg {
    background: var(--bp-text-bright);
    color: var(--bp-bg);
    border: none;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.15s;
}
.btn-cta-lg:hover { opacity: 0.88; color: var(--bp-bg); }

.btn-outline-lg {
    background: none;
    border: 1px solid var(--bp-border-strong);
    font: inherit;
    font-size: 14px;
    color: var(--bp-text);
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-outline-lg:hover { border-color: var(--bp-text-muted); color: var(--bp-text); }

/* Hero card */
.hero-card {
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    max-width: 780px;
    margin: 0 auto;
}
.card-bar {
    background: var(--bp-bg);
    border-bottom: 1px solid var(--bp-border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-dot { width: 10px; height: 10px; border-radius: 50%; }
.card-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--bp-border); }
.card-cell { background: var(--bp-surface); padding: 24px 20px; }
.cell-label { font-size: 10px; color: var(--bp-text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; margin-bottom: 8px; }
.cell-val { font-size: 18px; font-weight: 600; color: var(--bp-text-bright); margin-bottom: 4px; }
.cell-val.ok { color: var(--bp-success); }
.cell-sub { font-size: 11px; color: var(--bp-text-dim); line-height: 1.4; }

.divider { height: 1px; background: var(--bp-surface); margin: 56px 48px 0; }

/* Features */
.features {
    max-width: 1060px;
    margin: 0 auto;
    padding: 48px 48px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}
.feat-n { font-size: 10px; color: var(--bp-border-strong); font-weight: 600; letter-spacing: 0.08em; margin-bottom: 12px; }
.feat-t { font-size: 14px; font-weight: 500; color: var(--bp-text); margin-bottom: 6px; }
.feat-b { font-size: 13px; color: var(--bp-text-dim); line-height: 1.6; }

/* How it works */
.how { max-width: 1060px; margin: 0 auto; padding: 0 48px 72px; }
.how-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-top: 8px; }
.how-head h2 { font-size: 16px; font-weight: 600; color: var(--bp-text-bright); }
.how-head span { font-size: 12px; color: var(--bp-text-dim); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.step { background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 8px; padding: 24px; }
.step-n { font-size: 11px; color: var(--bp-border-strong); font-weight: 600; margin-bottom: 14px; letter-spacing: 0.06em; }
.step h3 { font-size: 14px; font-weight: 500; color: var(--bp-text); margin-bottom: 8px; }
.step p { font-size: 13px; color: var(--bp-text-dim); line-height: 1.6; }
.step-tag {
    display: inline-block;
    margin-top: 12px;
    font-size: 11px;
    color: var(--bp-success);
    background: rgba(63,185,80,0.1);
    border: 1px solid rgba(63,185,80,0.15);
    padding: 3px 9px;
    border-radius: 100px;
}

/* Footer */
footer, .site-footer {
    border-top: 1px solid var(--bp-surface);
    padding: 20px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
footer span, .site-footer span { font-size: 12px; color: var(--bp-text-dim); }

/* Admin layout */
.admin-layout { display: flex; flex: 1 1 auto; min-height: 0; }
.admin-sidebar { width: 220px; flex-shrink: 0; background: var(--bp-bg); border-right: 1px solid var(--bp-surface); padding: 24px 0; }
.sidebar-brand {
    font-size: 14px;
    font-weight: 600;
    color: var(--bp-text-bright);
    padding: 0 20px 20px;
    letter-spacing: -0.01em;
    display: block;
    border-bottom: 1px solid var(--bp-surface);
    margin-bottom: 16px;
}
.sidebar-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bp-text-dim);
    padding: 0 20px;
    margin: 16px 0 4px;
    display: block;
}
.sidebar-link {
    display: block;
    padding: 6px 20px;
    font-size: 13px;
    color: var(--bp-text-muted);
    text-decoration: none;
    border-radius: 0;
    transition: all 0.12s;
    border-left: 2px solid transparent;
}
.sidebar-link:hover { color: var(--bp-text-bright); background: var(--bp-surface); }
.sidebar-link.active { color: var(--bp-text-bright); border-left-color: var(--bp-link); background: rgba(31,111,235,0.06); }

/* No overflow-y here: a scroll container would stop position:sticky working on the save bar. */
.admin-main { flex: 1; padding: 40px 48px; background: var(--bp-bg); }

.page-title { font-size: 22px; font-weight: 600; color: var(--bp-text-bright); margin-bottom: 6px; letter-spacing: -0.02em; }
.page-subtitle { font-size: 14px; color: var(--bp-text-dim); margin-bottom: 32px; }

/* Cards */
.cp-card { background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 10px; padding: 24px; margin-bottom: 20px; }
.cp-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--bp-border);
}
.cp-card-header h2, .cp-card-header h3 { font-size: 15px; font-weight: 600; color: var(--bp-text-bright); margin: 0; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 8px; padding: 20px; }
.stat-value { font-size: 24px; font-weight: 600; color: var(--bp-text-bright); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; color: var(--bp-text-dim); }

/* Tables */
.cp-table { width: 100%; border-collapse: collapse; }
.cp-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bp-text-dim);
    padding: 8px 12px;
    border-bottom: 1px solid var(--bp-border);
}
.cp-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(33,38,45,0.6);
    font-size: 13px;
    color: var(--bp-text);
    vertical-align: middle;
}
.cp-table tr:hover td { background: rgba(22,27,34,0.5); }
.cp-table tr:last-child td { border-bottom: none; }

/* Badges */
.badge-success { background: rgba(63,185,80,0.1); color: var(--bp-success); padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 500; border: 1px solid rgba(63,185,80,0.15); }
.badge-muted { background: rgba(72,79,88,0.15); color: #6e7681; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 500; border: 1px solid var(--bp-border); }
.badge-warning { background: rgba(187,128,9,0.15); color: #d29922; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 500; border: 1px solid rgba(187,128,9,0.2); }
.badge-danger { background: rgba(248,81,73,0.1); color: var(--bp-danger); padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 500; border: 1px solid rgba(248,81,73,0.15); }

/* Forms */
.form-group { margin-bottom: 24px; }
.form-label-cp { display: block; font-size: 14px; font-weight: 500; color: var(--bp-text); margin-bottom: 8px; }
.form-control-cp {
    display: block;
    width: 100%;
    background: var(--bp-bg);
    border: 1px solid var(--bp-border-strong);
    color: var(--bp-text-bright);
    padding: 10px 14px;
    font: inherit;
    font-size: 14px;
    border-radius: 6px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control-cp:focus { outline: none; border-color: var(--bp-link); box-shadow: 0 0 0 3px rgba(31,111,235,0.15); }
.form-control-cp::placeholder { color: var(--bp-text-dim); }
.form-control-cp[readonly] { color: var(--bp-text-muted); }

/* Alerts */
.alert-cp-success { background: rgba(63,185,80,0.1); border: 1px solid rgba(63,185,80,0.2); color: var(--bp-success); border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; }
.alert-cp-danger { background: rgba(248,81,73,0.1); border: 1px solid rgba(248,81,73,0.2); color: var(--bp-danger); border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; }
.alert-cp-info { background: rgba(31,111,235,0.1); border: 1px solid rgba(31,111,235,0.2); color: var(--bp-link); border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; }

/* Buttons */
.btn-cp-primary {
    display: inline-block;
    background: var(--bp-text-bright);
    color: var(--bp-bg);
    border: none;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
}
.btn-cp-primary:hover { opacity: 0.88; color: var(--bp-bg); }

.btn-cp-secondary {
    display: inline-block;
    background: none;
    border: 1px solid var(--bp-border-strong);
    font: inherit;
    font-size: 13px;
    color: var(--bp-text);
    padding: 7px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s;
    text-decoration: none;
}
.btn-cp-secondary:hover { border-color: var(--bp-text-muted); color: var(--bp-text); }

.btn-cp-danger {
    display: inline-block;
    background: rgba(248,81,73,0.1);
    border: 1px solid rgba(248,81,73,0.2);
    font: inherit;
    font-size: 12px;
    color: var(--bp-danger);
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}
.btn-cp-danger:hover { background: rgba(248,81,73,0.18); color: var(--bp-danger); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* Auth cards */
.auth-container { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 8px; padding: 32px; width: 100%; max-width: 400px; }
.auth-logo { font-size: 15px; font-weight: 600; color: var(--bp-text-bright); text-align: center; margin-bottom: 24px; letter-spacing: -0.01em; }
.auth-title { font-size: 16px; font-weight: 600; color: var(--bp-text-bright); text-align: center; margin-bottom: 4px; letter-spacing: -0.01em; }
.auth-subtitle { font-size: 13px; color: var(--bp-text-muted); text-align: center; margin-bottom: 24px; }

.key-text {
    font-family: 'SF Mono', 'Fira Mono', 'Consolas', monospace;
    font-size: 12px;
    color: var(--bp-link);
    background: rgba(31,111,235,0.1);
    border: 1px solid rgba(31,111,235,0.15);
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}

.config-note { font-size: 13px; color: var(--bp-text-muted); margin-top: 8px; line-height: 1.6; }

/* Account page: plans and self-service */
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--bp-border); }
.plan-row:last-of-type { border-bottom: none; }
.plan-name { font-size: 15px; font-weight: 600; color: var(--bp-text-bright); }
.plan-row .config-note { margin-top: 2px; }
.licence-hint { margin-top: 14px; font-size: 14px; color: var(--bp-text); }
.text-button { background: none; border: none; padding: 0; margin-left: 10px; color: var(--bp-link); font: inherit; cursor: pointer; text-decoration: underline; }
.email-change-form { margin-top: 12px; }
.email-confirm-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.email-confirm-row .form-control-cp { max-width: 220px; }
.licence-warning { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13px; line-height: 1.6; color: var(--bp-text-muted); }
.licence-warning input { margin-top: 3px; }
.text-button-link { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--bp-text-dim); }

/* Utilities */
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.w-100 { width: 100%; }
.text-muted { color: var(--bp-text-dim) !important; }
.text-success { color: var(--bp-success) !important; }
.text-danger { color: var(--bp-danger) !important; }

@media (max-width: 768px) {
    .cp-nav { padding: 0 20px; }
    .admin-sidebar { display: none; }
    .admin-main { padding: 20px; }
    .features { grid-template-columns: repeat(2, 1fr); padding: 32px 20px; }
    .steps { grid-template-columns: 1fr; }
    .hero { padding: 48px 20px 0; }
    .divider { margin: 32px 20px 0; }
    .how { padding: 0 20px 48px; }
    .card-inner { grid-template-columns: repeat(2, 1fr); }
    footer, .site-footer { padding: 16px 20px; flex-direction: column; gap: 4px; text-align: center; }
    .notice { padding: 9px 20px; }
}

/* Post-back feedback (site.js): styled off the FORM, never the clicked button. */
.cp-submitting button { opacity: 0.55; pointer-events: none; }
.cp-submitting::after {
    content: "Working…";
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    padding: 12px 18px;
    border-radius: 8px;
    background: rgba(63, 185, 80, 0.15);
    border: 1px solid rgba(63, 185, 80, 0.35);
    color: var(--bp-success);
    font-size: 13px;
}

.alert-cp-success.cp-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    margin: 0;
    max-width: 420px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.alert-cp-success.cp-toast.cp-toast-hide { opacity: 0; transform: translateY(8px); pointer-events: none; }

.cp-save-bar {
    position: sticky;
    bottom: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(13, 17, 23, 0.92);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(240, 246, 252, 0.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.cp-save-status { color: var(--bp-success); font-size: 13px; margin-right: auto; }
