/* =====================================================================
   Nova in Cloud — Demo Console
   Design notes:
   - Palette anchored on Nova's brand purple (#5703ad / #7c3aed)
   - Deep ink background for the app chrome, light cards for content
   - Inter for UI/body, Space Grotesk for display headings
   - Signature element: the journey strip that traces the demo flow
   ===================================================================== */

:root {
    --nova-purple:      #7c3aed;
    --nova-purple-deep: #5703ad;
    --nova-cyan:        #22d3ee;
    --nova-pink:        #f472b6;

    --ink:        #14101f;
    --ink-soft:   #1e1830;
    --ink-line:   #2c2442;

    --paper:      #ffffff;
    --paper-soft: #f7f5fb;
    --paper-line: #e7e2f0;

    --text:       #1a1526;
    --text-soft:  #5b5470;
    --text-mute:  #8b85a0;
    --text-light: #efeaf8;
    --text-light-soft: #b9b0d6;

    --ok:    #16a34a;
    --ok-bg: #e8f7ee;
    --warn:  #d97706;
    --warn-bg: #fdf4e3;
    --err:   #dc2626;
    --err-bg: #fdeaea;

    --radius:    14px;
    --radius-sm: 9px;
    --shadow:    0 10px 40px -12px rgba(40, 18, 80, 0.35);
    --shadow-sm: 0 2px 10px -4px rgba(40, 18, 80, 0.25);

    --maxw: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--paper-soft);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    line-height: 1.2;
    margin: 0 0 0.4em;
    letter-spacing: -0.01em;
}

a { color: var(--nova-purple-deep); }

/* ---------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------- */
.topbar {
    background: var(--ink);
    color: var(--text-light);
    border-bottom: 1px solid var(--ink-line);
}
.topbar-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.01em;
}
.brand-logo {
    height: 26px;
    width: auto;
    display: block;
}
.login-brand {
    justify-content: center;
    margin-bottom: 18px;
}
.login-brand .brand-logo { height: 34px; }
.brand .mark {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--nova-cyan) -10%, var(--nova-purple) 50%, var(--nova-pink) 110%);
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 16px;
    box-shadow: 0 4px 14px -4px rgba(124, 58, 237, 0.7);
}
.brand .sub {
    color: var(--text-light-soft);
    font-weight: 400;
    font-size: 13px;
}
.topbar-user {
    display: flex; align-items: center; gap: 14px;
    font-size: 13px; color: var(--text-light-soft);
}
.topbar-user a { color: var(--text-light); text-decoration: none; }
.topbar-user a:hover { color: #fff; }

/* ---------------------------------------------------------------------
   Environment ribbon
   --------------------------------------------------------------------- */
.env-ribbon {
    background: var(--ink-soft);
    color: var(--text-light-soft);
    font-size: 12.5px;
    text-align: center;
    padding: 6px 16px;
    border-bottom: 1px solid var(--ink-line);
}
.env-ribbon strong { color: var(--text-light); font-weight: 600; }
.env-ribbon .dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    margin-right: 6px; vertical-align: middle;
}
.env-demo .dot { background: var(--nova-cyan); }
.env-production .dot { background: #f59e0b; }

/* ---------------------------------------------------------------------
   Journey strip — the signature element
   --------------------------------------------------------------------- */
.journey {
    background: var(--ink);
    border-bottom: 1px solid var(--ink-line);
    overflow-x: auto;
}
.journey-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: stretch;
    min-height: 52px;
}
.journey-step {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 18px 0 16px;
    color: var(--text-light-soft);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    transition: color .15s;
}
.journey-step:hover { color: #fff; }
.journey-step .num {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid var(--ink-line);
    display: grid; place-items: center;
    font-size: 11.5px; font-weight: 600;
    color: var(--text-light-soft);
    font-family: 'Space Grotesk', sans-serif;
    flex-shrink: 0;
}
.journey-step:not(:last-child)::after {
    content: '';
    position: absolute; right: 0; top: 50%;
    width: 1px; height: 20px; transform: translateY(-50%);
    background: var(--ink-line);
}
.journey-step.active { color: #fff; }
.journey-step.active .num {
    background: linear-gradient(135deg, var(--nova-purple) 0%, var(--nova-purple-deep) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 12px -3px rgba(124, 58, 237, 0.8);
}

/* ---------------------------------------------------------------------
   Layout shell
   --------------------------------------------------------------------- */
.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 36px 24px 80px;
}

.page-head { margin-bottom: 26px; }
.page-head .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--nova-purple);
    margin-bottom: 6px;
}
.page-head h1 { font-size: 30px; }
.page-head p { color: var(--text-soft); margin: 6px 0 0; max-width: 64ch; }

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.card {
    background: var(--paper);
    border: 1px solid var(--paper-line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 22px; }
.card h2 { font-size: 19px; }
.card h3 { font-size: 15px; }
.card .card-hint { color: var(--text-soft); font-size: 14px; margin-top: -2px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-weight: 600;
    font-size: 13.5px;
    margin-bottom: 7px;
    color: var(--text);
}
.field .help { font-weight: 400; color: var(--text-mute); font-size: 12.5px; }

input[type=text],
input[type=password],
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--paper-line);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--nova-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Subdomain input with a fixed suffix */
.subdomain-row {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--paper-line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.subdomain-row:focus-within {
    border-color: var(--nova-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.subdomain-row input {
    border: none; border-radius: 0; box-shadow: none; flex: 1;
}
.subdomain-row input:focus { box-shadow: none; }
.subdomain-row .suffix {
    background: var(--paper-soft);
    border-left: 1px solid var(--paper-line);
    padding: 12px 14px;
    color: var(--text-soft);
    font-size: 14px;
    display: flex; align-items: center;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--nova-purple) 0%, var(--nova-purple-deep) 100%);
    color: #fff;
    box-shadow: 0 6px 18px -6px rgba(124, 58, 237, 0.7);
}
.btn-primary:hover { box-shadow: 0 8px 22px -6px rgba(124, 58, 237, 0.85); }
.btn-ghost {
    background: #fff;
    color: var(--nova-purple-deep);
    border: 1px solid var(--paper-line);
}
.btn-ghost:hover { background: var(--paper-soft); }
.btn-danger {
    background: var(--err);
    color: #fff;
}
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   Alerts & notices
   --------------------------------------------------------------------- */
.alert {
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.alert-ok   { background: var(--ok-bg);   color: #14532d; border-color: #bbe6c9; }
.alert-warn { background: var(--warn-bg); color: #7c4a03; border-color: #f2dcab; }
.alert-err  { background: var(--err-bg);  color: #7f1d1d; border-color: #f3c4c4; }
.alert strong { font-weight: 600; }

/* ---------------------------------------------------------------------
   Result / key callout
   --------------------------------------------------------------------- */
.keycard {
    background: var(--ink);
    color: var(--text-light);
    border-radius: var(--radius);
    padding: 24px 26px;
    margin-top: 6px;
}
.keycard .label {
    text-transform: uppercase; letter-spacing: 0.12em;
    font-size: 11px; color: var(--text-light-soft); font-weight: 600;
}
.keycard .keyid {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 30px; font-weight: 600; color: #fff;
    margin: 6px 0 4px; letter-spacing: 0.5px;
}
.keycard .keynum { font-size: 13px; color: var(--text-light-soft); font-family: ui-monospace, monospace; }
.keycard .keymeta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; }
.keycard .keymeta span { color: var(--text-light-soft); }
.keycard .keymeta b { color: #fff; font-weight: 600; }
.keycard .keyactions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
    text-align: left; padding: 11px 12px;
    border-bottom: 1px solid var(--paper-line);
}
.table th {
    font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-mute); font-weight: 600;
}
.table td.mono, .table td .mono {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px;
}
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600;
}
.badge-active { background: var(--ok-bg); color: #14532d; }
.badge-terminated { background: var(--err-bg); color: #7f1d1d; }
.badge-plan { background: #efe7fb; color: var(--nova-purple-deep); }

/* ---------------------------------------------------------------------
   Nova widget host
   --------------------------------------------------------------------- */
.widget-host {
    margin-top: 8px;
    padding: 8px 4px 4px;
}
#nova-widget {
    --primary: var(--nova-purple);
    --radius: 0.625rem;
    --default-font-family: 'Inter', system-ui, sans-serif;
}

/* ---------------------------------------------------------------------
   Product hero & features (home page)
   --------------------------------------------------------------------- */
.hero {
    background:
        radial-gradient(110% 140% at 85% -20%, rgba(124,58,237,0.55) 0%, transparent 55%),
        radial-gradient(90% 120% at 0% 120%, rgba(34,211,238,0.35) 0%, transparent 50%),
        var(--ink);
    color: #fff;
    border-radius: 20px;
    padding: 48px 44px;
    overflow: hidden;
    position: relative;
}
.hero .badge-live {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 5px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
    color: #fff;
}
.hero .badge-live .pulse {
    width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74,222,128,0.7);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.hero h1 {
    font-size: 46px;
    margin: 18px 0 12px;
    max-width: 16ch;
    background: linear-gradient(120deg, #fff 30%, #d9c8ff 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p.lead {
    font-size: 18px; color: var(--text-light-soft);
    max-width: 52ch; margin: 0;
}
.hero .hero-points {
    display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 26px;
    list-style: none; padding: 0;
}
.hero .hero-points li {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--text-light);
}
.hero .hero-points li::before {
    content: '✓'; color: var(--nova-cyan); font-weight: 700;
}

.feature-section { margin-top: 36px; }
.feature-section .eyebrow {
    text-transform: uppercase; letter-spacing: 0.12em;
    font-size: 11.5px; font-weight: 600; color: var(--nova-purple); margin-bottom: 6px;
}
.feature-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px;
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-col h3 {
    font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--nova-purple-deep); margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 1px solid var(--paper-line);
}
.feature-col ul { list-style: none; padding: 0; margin: 0; }
.feature-col li {
    font-size: 13.5px; color: var(--text-soft);
    padding: 5px 0 5px 18px; position: relative;
}
.feature-col li::before {
    content: ''; position: absolute; left: 0; top: 12px;
    width: 6px; height: 6px; border-radius: 50%;
    background: linear-gradient(135deg, var(--nova-purple), var(--nova-cyan));
}

/* ---------------------------------------------------------------------
   Login page
   --------------------------------------------------------------------- */
.login-screen {
    min-height: 100vh;
    display: grid; place-items: center;
    background:
        radial-gradient(80% 80% at 80% 10%, rgba(124,58,237,0.4) 0%, transparent 55%),
        radial-gradient(70% 70% at 10% 100%, rgba(34,211,238,0.25) 0%, transparent 55%),
        var(--ink);
    padding: 24px;
}
.login-box {
    background: var(--paper);
    border-radius: 18px;
    padding: 40px 36px;
    width: 100%; max-width: 400px;
    box-shadow: var(--shadow);
}
.login-box .brand { color: var(--text); justify-content: center; margin-bottom: 8px; }
.login-box .brand .sub { color: var(--text-mute); }
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.login-box .sub-line { text-align: center; color: var(--text-soft); font-size: 14px; margin-bottom: 26px; }

/* ---------------------------------------------------------------------
   Misc
   --------------------------------------------------------------------- */
.muted { color: var(--text-mute); }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.divider { height: 1px; background: var(--paper-line); margin: 24px 0; border: none; }
.stack-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.small { font-size: 13px; }
.spacer-sm { height: 10px; }

.flow-link-card {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    text-decoration: none; color: inherit;
}
.flow-link-card .arrow { color: var(--nova-purple); font-size: 20px; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------------
   Copy button
   --------------------------------------------------------------------- */
.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn-copy:hover { background: rgba(255,255,255,0.16); }
.btn-copy.copied {
    background: var(--ok-bg);
    color: #14532d;
    border-color: #bbe6c9;
}
/* Copy buttons sitting on light cards */
.card .btn-copy {
    border-color: var(--paper-line);
    background: var(--paper-soft);
    color: var(--nova-purple-deep);
}
.card .btn-copy:hover { background: #efe7fb; }

/* Key ID + copy on one row */
.keyid-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.keyid-row .keyid { margin: 6px 0 4px; }

/* ---------------------------------------------------------------------
   Table row actions
   --------------------------------------------------------------------- */
.row-actions { white-space: nowrap; }
.row-actions a { margin-right: 12px; text-decoration: none; font-weight: 600; }
.row-actions a:last-child { margin-right: 0; }
.row-actions a:hover { text-decoration: underline; }
.danger-link { color: var(--err) !important; }

/* ---------------------------------------------------------------------
   Nova plan tiles (create + upgrade)
   --------------------------------------------------------------------- */
.plans-head { margin: 38px 0 18px; text-align: center; }
.plans-head h2 { font-size: 28px; }
.plans-head p { color: var(--text-soft); margin: 6px 0 0; }

.plan-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    align-items: start;
}
.plan-tiles.five {
    grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 1100px) { .plan-tiles.five { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .plan-tiles, .plan-tiles.five { grid-template-columns: 1fr; } }

.plan-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1.5px solid var(--paper-line);
    border-radius: var(--radius);
    padding: 22px 20px 20px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, box-shadow .15s, transform .1s;
}
.plan-tile:hover { border-color: #cdbff0; transform: translateY(-2px); }
.plan-tile input { position: absolute; opacity: 0; pointer-events: none; }

.plan-tile-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 22px;
    color: var(--text);
}
.plan-tile-tagline {
    font-size: 13px;
    color: var(--text-soft);
    margin-top: 8px;
    min-height: 3em;
    line-height: 1.45;
}
.plan-tile-price {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 25px;
    color: var(--text);
    margin: 12px 0 4px;
    white-space: nowrap;
}
.plan-tile-period {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-soft);
    white-space: nowrap;
    margin-left: 3px;
}
.plan-tile-select-btn {
    display: block;
    text-align: center;
    margin: 12px 0 4px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--paper-soft);
    border: 1px solid var(--paper-line);
    color: var(--nova-purple-deep);
    font-weight: 600;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.plan-tile:hover .plan-tile-select-btn { background: #efe7fb; }
.plan-tile-select-btn::before { content: 'Select plan'; }
.plan-tile input:checked ~ .plan-tile-select-btn {
    background: linear-gradient(135deg, var(--nova-purple) 0%, var(--nova-purple-deep) 100%);
    color: #fff;
    border-color: transparent;
}
.plan-tile input:checked ~ .plan-tile-select-btn::before { content: 'Selected ✓'; }

.plan-tile-benefits-label,
.plan-tile-group-label {
    text-transform: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--nova-purple);
    margin-top: 16px;
}
.plan-tile-benefits {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}
.plan-tile-benefits li {
    font-size: 13px;
    color: var(--text);
    padding: 3px 0 3px 22px;
    position: relative;
    line-height: 1.4;
}
.plan-tile-benefits li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 3px;
    color: var(--text);
    font-weight: 700;
}
.plan-tile-benefits.soon li::before { color: var(--nova-purple); }

.plan-tile-sku {
    margin-top: auto;
    padding-top: 16px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 10.5px;
    color: var(--text-mute);
    word-break: break-all;
}
.plan-tile-check {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--paper-line);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 14px;
    background: #fff;
    transition: background .15s, border-color .15s;
}
.plan-tile input:checked ~ .plan-tile-check {
    background: var(--nova-purple);
    border-color: var(--nova-purple);
}
.plan-tile:has(input:checked) {
    border-color: var(--nova-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

/* Session key management */
.session-key-card { margin-top: 22px; }
.session-key-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 4px;
}
.session-key-form input { flex: 1; min-width: 220px; }
