/* LX MAPPER — auth pages and admin dashboard.
   Deliberately self-contained: no external fonts or CDNs, so these pages work
   even if an outside service is unreachable. */

:root {
    --lx-bg:        #eef2f6;
    --lx-surface:   #ffffff;
    --lx-ink:       #1f2933;
    --lx-ink-soft:  #52606d;
    --lx-ink-faint: #7b8794;
    --lx-line:      #dbe3ea;
    --lx-brand:     #12406b;
    --lx-accent:    #2b6cb0;
    --lx-accent-dk: #22588f;
    --lx-danger:    #c0392b;
    --lx-danger-bg: #fdecea;
    --lx-ok:        #1e7a4d;
    --lx-ok-bg:     #e7f6ee;
    --lx-warn:      #8a6100;
    --lx-warn-bg:   #fdf3d8;
    --lx-radius:    10px;
    --lx-shadow:    0 2px 4px rgba(18,64,107,.05), 0 12px 32px rgba(18,64,107,.10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--lx-ink);
    background: var(--lx-bg);
    -webkit-font-smoothing: antialiased;
}

body.lx-auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
    background:
        radial-gradient(1100px 520px at 50% -12%, #dce7f1 0%, rgba(220,231,241,0) 62%),
        var(--lx-bg);
}

/* ------------------------------------------------------------------ card */

.lx-card {
    width: 100%;
    max-width: 430px;
    background: var(--lx-surface);
    border: 1px solid var(--lx-line);
    border-radius: var(--lx-radius);
    box-shadow: var(--lx-shadow);
    padding: 30px 32px 34px;
}

.lx-card-wide { max-width: 620px; }

/* Long pages (account, terms) must not be vertically centred — with content
   taller than the viewport, flex centring clips the top out of reach. */
body.lx-auth-tall {
    justify-content: flex-start;
    padding-top: 40px;
    padding-bottom: 40px;
}
body.lx-auth-tall .lx-card { max-width: 720px; }

.lx-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--lx-line);
}
.lx-brand img { border-radius: 8px; display: block; }
.lx-brand-name {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .35px;
    color: var(--lx-brand);
}
.lx-brand-sub { font-size: 12px; color: var(--lx-ink-faint); margin-top: 2px; }

.lx-h1 { font-size: 20px; margin: 0 0 6px; color: var(--lx-brand); }
.lx-sub { font-size: 13.5px; color: var(--lx-ink-soft); margin: 0 0 22px; line-height: 1.55; }

/* ------------------------------------------------------------------ form */

.lx-field { margin-bottom: 16px; }
.lx-field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--lx-ink-soft);
    margin-bottom: 6px;
}
.lx-field input,
.lx-field select,
.lx-field textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--lx-ink);
    background: #fbfcfd;
    border: 1px solid var(--lx-line);
    border-radius: 7px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.lx-field input:focus,
.lx-field select:focus,
.lx-field textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--lx-accent);
    box-shadow: 0 0 0 3px rgba(43,108,176,.15);
}
.lx-hint { font-size: 12px; color: var(--lx-ink-faint); margin-top: 5px; line-height: 1.5; }

.lx-btn {
    display: inline-block;
    width: 100%;
    padding: 11px 18px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--lx-accent);
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s;
}
.lx-btn:hover { background: var(--lx-accent-dk); }
.lx-btn:disabled { opacity: .6; cursor: not-allowed; }
.lx-btn-sm { width: auto; padding: 7px 13px; font-size: 13px; }
.lx-btn-ghost {
    background: transparent;
    color: var(--lx-accent);
    border: 1px solid var(--lx-line);
}
.lx-btn-ghost:hover { background: #f2f6fa; }
.lx-btn-danger { background: var(--lx-danger); }
.lx-btn-danger:hover { background: #a5301f; }

.lx-links {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--lx-line);
    font-size: 13px;
    color: var(--lx-ink-soft);
    text-align: center;
    line-height: 1.9;
}
.lx-links a { color: var(--lx-accent); text-decoration: none; }
.lx-links a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ notices */

.lx-notice {
    padding: 11px 14px;
    border-radius: 7px;
    font-size: 13.5px;
    line-height: 1.55;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.lx-notice-error { background: var(--lx-danger-bg); color: var(--lx-danger); border-color: #f5c6c0; }
.lx-notice-ok    { background: var(--lx-ok-bg);     color: var(--lx-ok);     border-color: #bfe5d0; }
.lx-notice-info  { background: #e8f1fa;             color: #1c4f7c;          border-color: #c3ddf2; }
.lx-notice-warn  { background: var(--lx-warn-bg);   color: var(--lx-warn);   border-color: #f0dda6; }

/* ------------------------------------------------------------------ footer */

.lx-foot {
    margin-top: 26px;
    font-size: 11.5px;
    color: var(--lx-ink-faint);
    text-align: center;
}
.lx-foot-sep { margin: 0 6px; }

/* ------------------------------------------------------------------ admin */

body.lx-admin {
    display: block;
    padding: 0;
    background: var(--lx-bg);
}

.lx-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 22px;
    background: var(--lx-brand);
    color: #fff;
}
.lx-topbar-title { font-weight: 700; letter-spacing: .3px; font-size: 15px; }
.lx-topbar-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    background: rgba(255,255,255,.16);
    padding: 3px 8px;
    border-radius: 4px;
}
.lx-topbar-spacer { flex: 1; }
.lx-topbar a { color: #cfe2f4; text-decoration: none; font-size: 13px; }
.lx-topbar a:hover { color: #fff; text-decoration: underline; }

.lx-wrap { max-width: 1240px; margin: 0 auto; padding: 22px; }

.lx-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.lx-stat {
    background: var(--lx-surface);
    border: 1px solid var(--lx-line);
    border-radius: 9px;
    padding: 14px 16px;
}
.lx-stat-n { font-size: 25px; font-weight: 700; color: var(--lx-brand); line-height: 1.1; }
.lx-stat-l {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--lx-ink-faint);
    margin-top: 5px;
}
.lx-stat-alert .lx-stat-n { color: var(--lx-danger); }

.lx-panel {
    background: var(--lx-surface);
    border: 1px solid var(--lx-line);
    border-radius: 9px;
    margin-bottom: 22px;
    overflow: hidden;
}
.lx-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--lx-line);
    background: #f7f9fb;
}
.lx-panel-head h2 { margin: 0; font-size: 14px; color: var(--lx-brand); }
.lx-panel-body { padding: 18px; }

.lx-tablewrap { overflow-x: auto; }
table.lx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.lx-table th,
table.lx-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid var(--lx-line);
    vertical-align: middle;
    white-space: nowrap;
}
table.lx-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--lx-ink-faint);
    background: #f7f9fb;
    font-weight: 600;
}
table.lx-table tr:last-child td { border-bottom: none; }
table.lx-table tbody tr:hover { background: #f9fbfd; }
.lx-cell-wrap { white-space: normal; min-width: 180px; }

.lx-pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
}
.lx-pill-PENDING   { background: var(--lx-warn-bg);   color: var(--lx-warn); }
.lx-pill-ACTIVE    { background: var(--lx-ok-bg);     color: var(--lx-ok); }
.lx-pill-SUSPENDED { background: var(--lx-danger-bg); color: var(--lx-danger); }
.lx-pill-REJECTED  { background: #eceff2;             color: var(--lx-ink-faint); }
.lx-pill-PRO       { background: #e5ecf7;             color: #234e86; }
.lx-pill-STANDARD  { background: #eaf0f4;             color: #46617a; }
.lx-pill-TRIAL     { background: #f2ebf8;             color: #6b3fa0; }
.lx-pill-NONE      { background: #eceff2;             color: var(--lx-ink-faint); }

.lx-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.lx-inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.lx-inline-form .lx-field { margin-bottom: 0; }
.lx-inline-form select,
.lx-inline-form input { min-width: 118px; }

.lx-muted { color: var(--lx-ink-faint); font-size: 12.5px; }
.lx-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

.lx-tabs { display: flex; gap: 4px; }
.lx-tabs a {
    padding: 6px 13px;
    font-size: 13px;
    color: var(--lx-ink-soft);
    text-decoration: none;
    border-radius: 6px;
}
.lx-tabs a:hover { background: #eef3f8; }
.lx-tabs a.active { background: var(--lx-accent); color: #fff; font-weight: 600; }

@media (max-width: 640px) {
    .lx-card { padding: 24px 20px 28px; }
    .lx-wrap { padding: 14px; }
    body.lx-auth { padding: 18px 14px; }
    body.lx-auth-tall { padding-top: 20px; }

    /* The admin tables carry a lot of columns; let them scroll rather than
       crushing every cell to unreadable width. */
    .lx-tablewrap { -webkit-overflow-scrolling: touch; }
    table.lx-table { min-width: 720px; }

    .lx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lx-topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
    .lx-inline-form { width: 100%; }
    .lx-inline-form .lx-field { flex: 1 1 130px; }
    .lx-inline-form select,
    .lx-inline-form input { min-width: 0; width: 100%; }
}
