:root {
    --bg-1: #0f1226;
    --bg-2: #1b2145;
    --accent: #6ee7b7;
    --accent-2: #7dd3fc;
    --text: #e6eaf6;
    --muted: #98a2c0;
    --card: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.08);
    --error-bg: rgba(248, 113, 113, 0.15);
    --error-fg: #fecaca;
    --success-bg: rgba(110, 231, 183, 0.12);
    --success-fg: #a7f3d0;

    /* --- Type system -----------------------------------------------------
     * Body text stays on a comfortable sans stack for long-form prose.
     * `--font-mono` (Share Tech Mono, terminal-style) is applied to
     * headings, buttons, IDs, digits and tables via targeted selectors
     * below — see `Monospace accents` section. Swap the family here to
     * change the whole app's technical typography in one line.           */
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
                 Arial, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
    --font-mono: 'Share Tech Mono', ui-monospace, 'SF Mono', Menlo, Consolas,
                 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(1200px 800px at 10% -10%, rgba(125, 211, 252, 0.15), transparent 60%),
        radial-gradient(1000px 700px at 90% 110%, rgba(110, 231, 183, 0.12), transparent 60%),
        linear-gradient(180deg, var(--bg-1), var(--bg-2));
    background-attachment: fixed;
    line-height: 1.55;
    min-height: 100vh;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ------ Header / Footer ---------------------------------------------------- */

.site-header {
    padding: 24px 0 8px;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}
.brand:hover { opacity: 0.9; }
.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 12px rgba(110, 231, 183, 0.6);
}
.brand-name { font-size: 15px; letter-spacing: 0.02em; }
.brand-tag  { color: var(--muted); font-size: 13px; }

.site-nav {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}
.site-nav .nav-link {
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
    border-bottom: 1px dotted transparent;
}
.site-nav .nav-link:hover {
    color: var(--text);
    border-bottom-color: var(--card-border);
}
.nav-form { display: inline-block; margin: 0; }
@media (max-width: 620px) {
    .site-nav .brand-tag { display: none; }
}

.site-footer {
    margin-top: 60px;
    padding: 24px 0 20px;
    color: var(--muted);
    text-align: center;
    border-top: 1px solid var(--card-border);
}
.site-footer a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px dotted var(--card-border);
}
.site-footer a:hover { color: var(--text); border-bottom-color: var(--muted); }

.footer-notice {
    max-width: 780px;
    margin: 0 auto 14px;
    padding: 0 12px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    opacity: 0.86;
}
.footer-notice strong { color: var(--text); opacity: 1; }
.footer-notice a { border-bottom-color: rgba(255,255,255,0.25); }

/* ------ Hero --------------------------------------------------------------- */

.hero {
    padding: 32px 0 12px;
}
.hero h1 {
    font-size: 34px;
    line-height: 1.15;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #fff, var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero .lede {
    color: var(--muted);
    margin: 0;
    font-size: 16px;
}

/* ------ Cards -------------------------------------------------------------- */

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    backdrop-filter: blur(8px);
}
.card h3 {
    margin-top: 0;
    color: #fff;
    font-size: 18px;
}
.card h4 {
    margin: 20px 0 6px;
    color: #dbeafe;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.card ol, .card ul { padding-left: 20px; color: var(--muted); }
.fwd-codes { margin: 6px 0 10px; }
.fwd-codes code { color: var(--text); }
.card code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #e0e7ff;
}

/* ------ Form --------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 18px; }

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 620px) {
    .row { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 500; font-size: 14px; }
.field .req { color: #fca5a5; }
.field small { color: var(--muted); font-size: 12px; }

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="file"],
select,
textarea {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.18);
    background: rgba(255, 255, 255, 0.06);
}
textarea { resize: vertical; min-height: 92px; }

.advanced {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--card-border);
    border-radius: 10px;
    padding: 12px 14px;
}
.advanced summary {
    cursor: pointer;
    color: var(--accent-2);
    font-size: 14px;
    outline: none;
}
.advanced .field { margin-top: 12px; }

.tos { color: var(--muted); font-size: 12px; }

.tos-agree {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}
.tos-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
}
.tos-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #6366f1;
    flex: 0 0 auto;
    cursor: pointer;
}
.tos-checkbox a {
    color: #a5b4fc;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.tos-checkbox a:hover { color: #c7d2fe; }
.tos-note {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.btn {
    display: inline-block;
    padding: 14px 22px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.06s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    color: #0f172a;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 24px rgba(125, 211, 252, 0.25);
}
.btn-ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    text-decoration: none;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.10); }
.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
}

button.linklike {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-2);
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}
button.linklike:hover { text-decoration: underline; }

.auth-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    width: 100%;
    margin: 18px 0;
    font-size: 14px;
}
.auth-actions .inline-form { display: inline; margin: 0; }
.auth-actions .dot-sep    { color: var(--muted); }

/* ------ Edit profile ------------------------------------------------------ */

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}
.form-actions .btn-ghost { text-decoration: none; }

input.readonly,
input[readonly],
input:disabled {
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    cursor: not-allowed;
}

.badge-inline {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--success-bg);
    color: var(--success-fg);
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.02em;
}

label.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
}
label.checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-2);
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 8px 0 4px;
}
label.radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
}
label.radio input[type="radio"] {
    accent-color: var(--accent-2);
}
fieldset.notify-channel,
fieldset.options-block {
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 12px 14px 10px;
    margin: 0 0 16px;
}
fieldset.notify-channel legend,
fieldset.options-block legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 13px;
}
fieldset.options-block small {
    display: block;
    margin-top: 8px;
    line-height: 1.45;
}

/* ------ Billing ----------------------------------------------------------- */

.billing-card h3 { display: flex; align-items: center; gap: 10px; }
.billing-card h4 {
    margin-top: 22px;
    margin-bottom: 8px;
    color: #dbeafe;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1px solid transparent;
}
.pill-paid        { background: var(--success-bg); color: var(--success-fg); border-color: rgba(110,231,183,0.35); }
.pill-pending     { background: rgba(250,204,21,0.15); color: #fde68a; border-color: rgba(250,204,21,0.35); }
.pill-due         { background: rgba(125,211,252,0.15); color: #cfe7fa; border-color: rgba(125,211,252,0.35); }
.pill-failed      { background: var(--error-bg); color: var(--error-fg); border-color: rgba(248,113,113,0.35); }
.pill-defaulted   { background: var(--error-bg); color: var(--error-fg); border-color: rgba(248,113,113,0.55); }
.pill-unactivated { background: rgba(251,146,60,0.15); color: #fdba74; border-color: rgba(251,146,60,0.45); }
.pill-free          { background: rgba(125,211,252,0.15); color: #cfe7fa; border-color: rgba(125,211,252,0.35); }
.pill-trial_expired { background: rgba(251,146,60,0.15); color: #fdba74; border-color: rgba(251,146,60,0.45); }

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.invoice-table th,
.invoice-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--card-border);
}
.invoice-table th {
    color: var(--muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.invoice-table td.num,
.invoice-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-table td a {
    color: var(--accent-2);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-2);
}
.invoice-table td a:hover { color: #fff; }
.invoice-table tr:last-child td { border-bottom: none; }

.alert-success {
    background: var(--success-bg);
    color: var(--success-fg);
    border: 1px solid rgba(110, 231, 183, 0.35);
}

/* Honeypot: hidden from users, visible to naive bots. */
.hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* ------ Alerts ------------------------------------------------------------- */

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin: 12px 0;
    font-size: 14px;
}
.alert-error {
    background: var(--error-bg);
    color: var(--error-fg);
    border: 1px solid rgba(248, 113, 113, 0.35);
}
.alert-info {
    background: rgba(125, 211, 252, 0.12);
    color: #cfe7fa;
    border: 1px solid rgba(125, 211, 252, 0.3);
}
.alert-warning {
    background: rgba(250, 204, 21, 0.12);
    color: #fde68a;
    border: 1px solid rgba(250, 204, 21, 0.35);
}

/* ------ Auth pages --------------------------------------------------------- */

.auth-form { max-width: 480px; margin-left: auto; margin-right: auto; }

.otp-input {
    letter-spacing: 0.55em;
    font-size: 22px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.profile-dl {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 16px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}
.profile-dl dt { color: var(--text); font-weight: 500; }
.profile-dl dd { margin: 0; color: var(--muted); }
.profile-dl .preline { white-space: pre-line; }
@media (max-width: 620px) {
    .profile-dl { grid-template-columns: 1fr; gap: 2px 0; }
    .profile-dl dt { margin-top: 10px; }
}

/* ------ Success ------------------------------------------------------------ */

.success-card {
    text-align: center;
    padding: 32px 24px;
    background: linear-gradient(135deg, rgba(110, 231, 183, 0.08), rgba(125, 211, 252, 0.08));
    border-color: rgba(110, 231, 183, 0.3);
}
.did-label { color: var(--muted); margin: 0 0 6px; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; }
.did-number {
    font-size: 34px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #fff;
    letter-spacing: 0.02em;
}
.mobile-line { color: var(--muted); margin: 6px 0; font-size: 14px; }
.badge {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--success-bg);
    color: var(--success-fg);
    border-radius: 999px;
    font-size: 12px;
}

/* ------ Misc --------------------------------------------------------------- */

.cta-back {
    text-align: center;
    margin: 24px 0;
}
.cta-back a {
    color: var(--accent-2);
    text-decoration: none;
    font-size: 14px;
}
.cta-back a:hover { text-decoration: underline; }
.info ol { margin: 8px 0; }

/* ------ Monospace accents -------------------------------------------------
 * Apply Share Tech Mono (via --font-mono) to headings, brand, buttons,
 * pills, IDs, tables, code and profile key/value pairs. Long-form prose
 * (paragraphs, lede, footer notice, alerts) intentionally stays on the
 * body sans stack so readability doesn't suffer.
 *
 * Share Tech Mono ships as a single regular weight. We allow the browser
 * to synthesize a bold face for `<strong>` and headings so headings still
 * feel weightier than surrounding copy.                                  */

h1, h2, h3, h4, h5, h6,
.brand-name,
.btn,
.pill,
.did-label, .did-number,
.profile-dl dt, .profile-dl dd,
.invoice-table th, .invoice-table td,
code, kbd, samp,
.otp-input,
.footer-notice strong {
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    font-synthesis: weight;
}

/* Slightly tighten the DID number — Share Tech Mono's default tracking
 * is generous, and the DID looks best cinched.                          */
.did-number { letter-spacing: 0.03em; }

/* Uppercase pills already look "computed" — pair well with the mono. */
.pill { letter-spacing: 0.04em; }

/* Buttons: monospace with slightly wider tracking. Case is left as-is so
 * primary CTAs like "Pay ₹99 now" don't shout. Add
 *   .btn { text-transform: uppercase; }
 * later if you want the full terminal aesthetic.                         */
.btn { letter-spacing: 0.04em; }

/* Invoice table numeric column — monotype naturally aligns digits, so
 * we can drop the fixed-width hack elsewhere.                            */
.invoice-table td.num, .invoice-table th.num { font-variant-numeric: tabular-nums; }

/* ------ Admin console ----------------------------------------------------- */

body.admin-wide .container { max-width: 1180px; }

.admin-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
.admin-hero .lede { margin-bottom: 0; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin: 8px 0 18px;
}
.admin-stats .stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.admin-stats .stat strong {
    font-family: var(--font-mono);
    font-size: 22px;
    color: var(--text);
    letter-spacing: 0.02em;
    text-transform: none;
}
.admin-stats .stat.on {
    border-color: rgba(125, 211, 252, 0.45);
    background: rgba(125, 211, 252, 0.08);
}

.admin-search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}
.admin-search input[type="search"] {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 14px;
}

.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table th,
.admin-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--card-border);
    vertical-align: top;
}
.admin-table th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}
.cell-name { color: var(--text); font-weight: 500; }
.cell-sub { color: var(--muted); font-size: 12px; }
.cell-actions { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.muted { color: var(--muted); }

.btn-danger {
    color: #fecaca;
    background: rgba(248, 113, 113, 0.18);
    border: 1px solid rgba(248, 113, 113, 0.35);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.28); }

.admin-modal[hidden] { display: none !important; }
.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px 48px;
}
.admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 24, 0.72);
}
.admin-modal-card {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: calc(100vh - 80px);
    overflow: auto;
    background: linear-gradient(180deg, #161b3a, #12162e);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 18px 20px 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.admin-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.admin-modal-head h2 { margin: 0; font-size: 20px; }
.admin-meta { margin: 0 0 6px; }
.admin-h3 {
    margin: 22px 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #dbeafe;
}
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 12px 0 10px;
}
.admin-period {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 13px;
}
.admin-edit-form { margin-top: 14px; }
.admin-edit-form .checkbox { display: flex; margin: 8px 0; }
.admin-flash {
    margin: 8px 0;
    font-size: 13px;
}
.admin-flash.ok { color: var(--success-fg); }
.admin-flash.err { color: var(--error-fg); }

@media (max-width: 820px) {
    .admin-stats { grid-template-columns: repeat(3, 1fr); }
    .admin-hero { flex-direction: column; align-items: flex-start; }
}
