/* ERS login — reuses the ERS / BI Analytics design tokens. */
:root {
    --bg: #0b1020;
    --panel: #121933;
    --line: rgba(255,255,255,.08);
    --text: #eef2ff;
    --muted: #95a1c2;
    --accent: #5b8cff;
    --accent-2: #1fd1a5;
    --danger: #ff6b81;
    --warning: #f7b84b;
    --shadow: 0 18px 40px rgba(0,0,0,.28);
    --radius: 18px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(91,140,255,.12), transparent 28%),
        radial-gradient(circle at top right, rgba(31,209,165,.08), transparent 25%),
        var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.ers-login {
    width: 100%;
    max-width: 420px;
}

.ers-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px 26px;
    width: 100%;
}

.ers-brand {
    text-align: center;
    margin-bottom: 22px;
}

.ers-badge {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: .04em;
    background: linear-gradient(135deg, var(--accent), #7c5cff);
    box-shadow: 0 8px 20px rgba(91,140,255,.25);
}

.ers-title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: .06em;
}

.ers-sub {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: .08em;
}

.ers-tabs {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border-radius: 16px;
    background: rgba(255,255,255,.035);
    border: 1px solid var(--line);
    width: 100%;
    margin-bottom: 20px;
}

.ers-tab {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: .18s ease;
}

.ers-tab:hover {
    color: var(--text);
    background: rgba(255,255,255,.04);
}

.ers-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #6a61ff);
    box-shadow: 0 8px 20px rgba(91,140,255,.25);
}

.ers-tab:focus-visible,
.ers-btn:focus-visible,
.ers-link:focus-visible,
.ers-input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.ers-panel { display: none; }
.ers-panel.active { display: block; }

.ers-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 6px;
}

.ers-input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(8,13,28,.55);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

.ers-input::placeholder { color: #5c688a; }

.ers-input:focus {
    border-color: var(--accent);
    background: rgba(8,13,28,.8);
}

.ers-phone {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(8,13,28,.55);
    margin-bottom: 16px;
    overflow: hidden;
}

.ers-phone__input {
    border: 0;
    border-radius: 0;
    margin: 0;
    background: transparent;
    flex: 1;
    min-width: 0;
}

.ers-prefix {
    display: flex;
    align-items: center;
    padding: 0 10px 0 14px;
    color: var(--muted);
    font-size: 15px;
    white-space: nowrap;
    border-right: 1px solid var(--line);
}

.ers-btn {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #6a61ff);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .18s ease;
}

.ers-btn:hover { filter: brightness(1.08); }
.ers-btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }

.ers-hint {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.ers-otp__input {
    text-align: center;
    letter-spacing: .5em;
    font-size: 20px;
    padding-left: calc(14px + .5em);
}

.ers-otp__input[readonly] {
    opacity: .75;
}

.ers-otp__status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.ers-otp__status[hidden] { display: none; }

.ers-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ers-spin .8s linear infinite;
    flex: none;
}

@keyframes ers-spin { to { transform: rotate(360deg); } }

.ers-otp__actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.ers-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.ers-link:disabled { color: var(--muted); cursor: default; }

.ers-alert {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    border: 1px solid transparent;
}

.ers-alert.is-error {
    color: var(--danger);
    border-color: rgba(255,107,129,.35);
    background: rgba(255,107,129,.08);
}

.ers-alert.is-ok {
    color: var(--accent-2);
    border-color: rgba(31,209,165,.35);
    background: rgba(31,209,165,.08);
}

@media (max-width: 390px) {
    body { padding: 16px 12px; }
    .ers-card { padding: 22px 16px 20px; }
    .ers-title { font-size: 26px; }
    .ers-prefix { padding: 0 8px 0 10px; font-size: 14px; }
    .ers-input { font-size: 14px; }
}
