:root {
    color-scheme: dark;
    --background: #08070d;
    --surface: rgba(19, 16, 29, 0.88);
    --surface-strong: #15111f;
    --surface-soft: #201a2e;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(175, 139, 255, 0.25);
    --text: #faf8ff;
    --text-soft: #aaa2ba;
    --text-muted: #746c82;
    --purple: #9568ff;
    --purple-dark: #6237d2;
    --green: #75e7a6;
    --red: #ff7f95;
    --yellow: #f7ce79;
    --shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(
            circle at 75% 15%,
            rgba(126, 73, 241, 0.17),
            transparent 30%
        ),
        radial-gradient(
            circle at 8% 92%,
            rgba(87, 52, 159, 0.18),
            transparent 32%
        ),
        var(--background);
    color: var(--text);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

.ambient {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.ambient-one {
    top: -180px;
    right: -120px;
    width: 520px;
    height: 520px;
    background: rgba(116, 67, 229, 0.15);
}

.ambient-two {
    bottom: -220px;
    left: -120px;
    width: 500px;
    height: 500px;
    background: rgba(76, 45, 139, 0.16);
}

.login-view {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
}

.login-shell {
    display: grid;
    width: min(1120px, 100%);
    min-height: 680px;
    grid-template-columns: 1.15fr 0.85fr;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 32px;
    background: rgba(14, 12, 21, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
}

.login-identity {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px;
    background:
        radial-gradient(
            circle at 50% 40%,
            rgba(150, 96, 255, 0.22),
            transparent 38%
        ),
        linear-gradient(
            145deg,
            rgba(30, 23, 48, 0.95),
            rgba(12, 10, 19, 0.92)
        );
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 15px;
    background: linear-gradient(145deg, #a675ff, #6032ce);
    box-shadow: 0 16px 40px rgba(105, 59, 210, 0.35);
    font-size: 15px;
    font-weight: 900;
}

.brand-mark.small {
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 16px;
}

.brand span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.wolf-orbit,
.loba-avatar-shell {
    position: relative;
    display: grid;
    place-items: center;
    margin: auto;
}

.wolf-orbit {
    width: 260px;
    height: 260px;
}

.orbit,
.pulse {
    position: absolute;
    border: 1px solid rgba(165, 117, 255, 0.20);
    border-radius: 50%;
}

.orbit-one {
    inset: 5px;
}

.orbit-two {
    inset: 32px;
    border-style: dashed;
}

.wolf-avatar,
.loba-avatar {
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background:
        radial-gradient(
            circle at 35% 25%,
            rgba(255, 255, 255, 0.24),
            transparent 25%
        ),
        linear-gradient(145deg, #a873ff, #40208c);
    box-shadow:
        0 0 80px rgba(129, 76, 235, 0.38),
        inset 0 0 50px rgba(255, 255, 255, 0.07);
}

.wolf-avatar {
    width: 150px;
    height: 150px;
    font-size: 72px;
}

.eyebrow,
.window-kicker {
    color: #a98aff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.login-identity h1 {
    max-width: 520px;
    margin: 12px 0;
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.lead {
    max-width: 520px;
    margin: 0;
    color: var(--text-soft);
    font-size: 16px;
    line-height: 1.7;
}

.security-line,
.system-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    border: 1px solid rgba(117, 231, 166, 0.15);
    border-radius: 999px;
    background: rgba(63, 180, 109, 0.07);
    color: #a4f2c4;
    font-size: 12px;
}

.security-line {
    padding: 10px 13px;
}

.system-pill {
    padding: 8px 12px;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 16px var(--green);
}

.login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(34px, 6vw, 72px);
    background: rgba(11, 9, 16, 0.82);
}

.login-copy {
    margin-bottom: 34px;
}

.badge {
    display: inline-flex;
    padding: 7px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(133, 83, 238, 0.08);
    color: #b99cff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.login-copy h2 {
    margin: 18px 0 8px;
    font-size: 30px;
    letter-spacing: -0.03em;
}

.login-copy p,
.section-header p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

form label {
    display: block;
    margin-bottom: 18px;
    color: #c9c2d6;
    font-size: 12px;
    font-weight: 700;
}

form input {
    width: 100%;
    margin-top: 9px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    padding: 14px 15px;
    transition: 160ms ease;
}

form input:focus {
    border-color: rgba(155, 108, 255, 0.65);
    box-shadow: 0 0 0 4px rgba(136, 87, 238, 0.09);
}

.primary-button,
.ghost-button,
.provider-action {
    border: 0;
    border-radius: 13px;
    color: white;
    font-weight: 800;
}

.primary-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(145deg, #a16eff, #6134d1);
    box-shadow: 0 16px 35px rgba(102, 57, 208, 0.27);
}

.primary-button:disabled {
    opacity: 0.55;
}

.ghost-button {
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
}

.form-message,
.global-message {
    min-height: 22px;
    margin: 4px 0 12px;
    color: var(--red);
    font-size: 12px;
}

.form-message.success,
.global-message.success {
    color: var(--green);
}

.login-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--text-muted);
    font-size: 11px;
}

.dashboard-view {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 7, 13, 0.82);
    backdrop-filter: blur(20px);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-name {
    color: var(--text-soft);
    font-size: 13px;
}

.workspace {
    width: min(1600px, 100%);
    margin: auto;
    padding: 22px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(380px, 0.9fr) minmax(500px, 1.1fr);
    gap: 18px;
}

.window,
.providers-section {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.window {
    min-height: 570px;
}

.window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 0 22px;
    border-bottom: 1px solid var(--border);
}

.window-header h2,
.section-header h2 {
    margin: 5px 0 0;
    font-size: 17px;
}

.terminal-lights {
    display: flex;
    gap: 7px;
}

.terminal-lights i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
}

.terminal-lights i:first-child {
    background: #ff748a;
}

.terminal-lights i:nth-child(2) {
    background: #f1ca70;
}

.terminal-lights i:last-child {
    background: #75e7a6;
}

.terminal-window {
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.terminal-output {
    padding: 24px;
    color: #c8c1d4;
    font: 13px/1.9 "SFMono-Regular", Consolas, monospace;
}

.terminal-output p {
    margin: 0 0 5px;
}

.terminal-output b {
    color: #bb9dff;
}

.terminal-output .success {
    color: var(--green);
}

.terminal-output .muted {
    color: var(--text-muted);
}

.command-bar,
.chat-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
}

.command-bar span {
    color: #aa86ff;
    font-family: monospace;
}

.command-bar input,
.chat-input input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-muted);
}

.command-bar button,
.chat-input button {
    border: 0;
    border-radius: 10px;
    padding: 10px 13px;
    background: var(--surface-soft);
    color: var(--text-muted);
}

.loba-content {
    display: flex;
    min-height: 495px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 26px;
    text-align: center;
}

.loba-avatar-shell {
    width: 180px;
    height: 180px;
}

.pulse-one {
    inset: 0;
}

.pulse-two {
    inset: 23px;
    border-style: dashed;
}

.loba-avatar {
    width: 115px;
    height: 115px;
    font-size: 54px;
}

.loba-copy {
    margin-top: 22px;
}

.loba-copy h3 {
    margin: 15px 0 8px;
    font-size: 27px;
    letter-spacing: -0.03em;
}

.loba-copy p {
    max-width: 520px;
    margin: 0 auto;
    color: var(--text-soft);
    line-height: 1.6;
}

.chat-preview {
    width: min(610px, 100%);
    margin-top: 30px;
}

.chat-message {
    display: flex;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.025);
    text-align: left;
}

.chat-message p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.55;
}

.chat-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    background: rgba(141, 91, 239, 0.16);
}

.providers-section {
    margin-top: 18px;
    padding: 24px;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.section-header p {
    max-width: 700px;
    margin-top: 8px;
    font-size: 13px;
}

.provider-summary {
    text-align: right;
}

.provider-summary strong {
    display: block;
    font-size: 34px;
    color: #b99cff;
}

.provider-summary span {
    color: var(--text-muted);
    font-size: 11px;
}

.providers-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.loading-card,
.provider-card {
    min-height: 220px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.025);
}

.loading-card {
    display: grid;
    grid-column: 1 / -1;
    place-items: center;
    color: var(--text-muted);
}

.provider-card {
    padding: 18px;
}

.provider-card.configured {
    border-color: rgba(117, 231, 166, 0.22);
}

.provider-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.provider-symbol {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: rgba(145, 95, 244, 0.13);
    color: #c1a7ff;
    font-weight: 900;
}

.provider-name {
    flex: 1;
}

.provider-name strong,
.provider-name span {
    display: block;
}

.provider-name span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.provider-status {
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.provider-card.configured .provider-status {
    background: rgba(74, 189, 118, 0.10);
    color: var(--green);
}

.provider-fields {
    display: grid;
    gap: 10px;
    margin-top: 17px;
}

.provider-fields input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: 0;
    background: rgba(0, 0, 0, 0.18);
    color: var(--text);
    padding: 11px 12px;
    font-size: 12px;
}

.provider-fields input:focus {
    border-color: rgba(155, 108, 255, 0.55);
}

.provider-actions {
    display: flex;
    gap: 9px;
    margin-top: 13px;
}

.provider-action {
    flex: 1;
    padding: 10px;
    background: linear-gradient(145deg, #9664ff, #6335d2);
    font-size: 11px;
}

.provider-action.delete {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 127, 149, 0.18);
    background: rgba(255, 127, 149, 0.07);
    color: var(--red);
}

@media (max-width: 1100px) {
    .login-shell,
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .login-identity {
        min-height: 600px;
    }

    .providers-grid {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }
}

@media (max-width: 720px) {
    .login-view {
        padding: 12px;
    }

    .login-shell {
        border-radius: 22px;
    }

    .login-identity,
    .login-card {
        padding: 28px;
    }

    .wolf-orbit {
        width: 210px;
        height: 210px;
    }

    .topbar {
        align-items: flex-start;
        padding: 15px;
    }

    .system-pill,
    .admin-name {
        display: none;
    }

    .workspace {
        padding: 12px;
    }

    .providers-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .provider-summary {
        text-align: left;
    }
}
