@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================================
   ERT Design System — locked. Inherited by ALL ERT products.
   ============================================================ */

:root {
    /* Brand */
    --accent:          #e77a35;
    --accent-hover:    #d56a25;
    --accent-active:   #c25e1e;
    --accent-soft:     rgba(231,122,53,0.10);
    --accent-soft-2:   rgba(231,122,53,0.18);
    --border-accent:   rgba(231,122,53,0.40);

    /* Surfaces */
    --bg-page:         #1a1d26;
    --bg-card:         #313745;
    --bg-inset:        #252934;
    --bg-sidebar:      #1a1d26;
    --bg-hover:        #3a4154;

    /* Borders */
    --border:          #3d4456;
    --border-strong:   #4d5468;

    /* Text */
    --text:            #e6e9f0;
    --muted:           #9098a8;
    --muted-2:         #6b7385;
    --disabled:        #4d5468;

    /* Status */
    --status-success:  #4ade80;
    --status-warning:  #facc15;
    --status-error:    #f87171;
    --status-info:     #60a5fa;
    --status-neutral:  #9098a8;

    /* Layout */
    --header-h:        72px;
    --subbar-h:        48px;
    --sidebar-w:       240px;
    --radius:          8px;
    --radius-sm:       6px;

    /* Typography */
    --font-heading: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-body:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-mono:    ui-monospace, SFMono-Regular, 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-page);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.18s ease;
}

a:hover { color: var(--accent-hover); }

p { margin: 0 0 1em; color: var(--text); }

.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }

code, pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* ---------- Brand tile (white background behind logo on dark surfaces) ---------- */

.brand-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.brand-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-lockup .brand-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    color: var(--text);
}

.brand-lockup .brand-sub {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--muted);
    font-size: 0.85rem;
}

/* ---------- Cards & surfaces ---------- */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.card-inset {
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-primary:active { background: var(--accent-active); border-color: var(--accent-active); }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

/* ---------- Forms ---------- */

.field {
    display: block;
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 6px;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft-2);
}

/* ---------- App shell (sidebar + header + content) ---------- */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
    grid-template-areas:
        "sidebar header"
        "sidebar content";
    min-height: 100vh;
}

.app-header {
    grid-area: header;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
}

.app-sidebar {
    grid-area: sidebar;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-sidebar .brand-lockup {
    padding: 0 8px 20px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.app-sidebar a.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.app-sidebar a.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.app-sidebar a.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--border-accent);
}

.app-content {
    grid-area: content;
    padding: 32px;
    overflow-y: auto;
}

/* ---------- Centred auth / marketing screens ---------- */

.center-stage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.center-stage .card {
    width: 100%;
    max-width: 440px;
}

/* ---------- Badges / status pills ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--border-accent);
}

.badge-success { background: rgba(74,222,128,0.10); color: var(--status-success); border-color: rgba(74,222,128,0.35); }
.badge-warning { background: rgba(250,204,21,0.10); color: var(--status-warning); border-color: rgba(250,204,21,0.35); }
.badge-error   { background: rgba(248,113,113,0.10); color: var(--status-error);   border-color: rgba(248,113,113,0.35); }
.badge-info    { background: rgba(96,165,250,0.10); color: var(--status-info);    border-color: rgba(96,165,250,0.35); }
.badge-neutral { background: rgba(144,152,168,0.10); color: var(--status-neutral); border-color: rgba(144,152,168,0.35); }
