﻿:root {
    --bg: #121214;
    --surface: #1c1c21;
    --surface-soft: #16161b;
    --border: rgba(255, 255, 255, 0.08);
    --text: #e6e6ea;
    --muted: #a1a1aa;
    --accent: #6382f2;
    --accent-strong: #5271e0;
    --danger: #ff6b7b;
    --success: #4ade80;
    --radius-xl: 20px;
    --radius-md: 12px;
    --shadow: 0 28px 68px rgba(0, 0, 0, 0.5);
    --font-main: 'Manrope', 'Inter', 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.manage-login {
    position: relative;
    overflow: hidden;
    font-family: var(--font-main);
    color: var(--text);
    background: #121214;
}

.background-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        url("/img/emd.png") left max(2%, 38px) center / clamp(190px, 20vw, 480px) auto no-repeat,
        url("/img/telemix.png") right max(2%, 38px) center / clamp(190px, 22vw, 500px) auto no-repeat;
    opacity: 0.05;
    filter: saturate(0.65) blur(0.35px);
}

.glow {
    position: fixed;
    inset: -28% -20% auto auto;
    width: clamp(340px, 56vw, 920px);
    height: clamp(340px, 56vw, 920px);
    background: radial-gradient(closest-side at 40% 40%, rgba(99, 130, 242, 0.11), rgba(18, 18, 20, 0));
    filter: blur(58px);
    opacity: 0.72;
    pointer-events: none;
    z-index: 0;
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(460px, 100%);
    background:
        radial-gradient(135% 120% at 0% 0%, rgba(99, 130, 242, 0.12), transparent 58%),
        radial-gradient(100% 120% at 100% 100%, rgba(242, 140, 40, 0.08), transparent 62%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    padding: 28px;
}

.login-header {
    margin-bottom: 20px;
}

.login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.login-brand-logo {
    display: block;
    width: min(150px, 52%);
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
}

.login-badge {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 0.14em;
    font-weight: 800;
    color: #b8c5e8;
}

.login-header h1 {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2.1vw, 1.82rem);
    line-height: 1.2;
    color: #f4f4f6;
}

.login-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

.login-autologin {
    display: none;
    gap: 12px;
    justify-items: center;
    text-align: center;
    margin-bottom: 8px;
    padding: 14px 0 8px;
}

.login-autologin-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.14);
    border-top-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(99, 130, 242, 0.08);
    animation: login-spin 900ms linear infinite;
}

.login-autologin-badge {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.14em;
    font-weight: 800;
    color: #b8c5e8;
}

.login-autologin h2 {
    margin: 0;
    font-size: clamp(1.1rem, 1.8vw, 1.45rem);
    line-height: 1.2;
    color: #f4f4f6;
}

.login-autologin-message {
    margin: 0;
    max-width: 28ch;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-field {
    display: grid;
    gap: 7px;
}

.login-field span {
    font-size: 0.88rem;
    color: #c9c9d2;
}

.login-field input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 12px 13px;
    font-size: 0.95rem;
    background: var(--surface-soft);
    color: var(--text);
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.login-field input::placeholder {
    color: rgba(230, 230, 234, 0.42);
}

.login-field input:focus {
    outline: none;
    border-color: rgba(99, 130, 242, 0.82);
    box-shadow: 0 0 0 3px rgba(99, 130, 242, 0.2);
    background: #131319;
}

.login-submit {
    margin-top: 4px;
    border: 0;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 0.96rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 8px 20px rgba(99, 130, 242, 0.28);
    transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.login-submit:disabled {
    opacity: 0.64;
    cursor: not-allowed;
    transform: none;
}

.login-feedback {
    min-height: 22px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.login-feedback.error {
    color: var(--danger);
}

.login-feedback.success {
    color: var(--success);
}

html.manage-autologin-probe .login-header p,
html.manage-autologin-probe .login-form {
    display: none;
}

html.manage-autologin-probe .login-autologin {
    display: grid;
}

@keyframes login-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .background-container {
        background:
            url("/img/emd.png") left 5% top 16% / clamp(130px, 34vw, 320px) auto no-repeat,
            url("/img/telemix.png") right 5% bottom 14% / clamp(130px, 36vw, 340px) auto no-repeat;
        opacity: 0.05;
    }
}

@media (max-width: 640px) {
    .login-shell {
        padding: 16px;
    }

    .login-card {
        padding: 22px 18px;
        border-radius: 16px;
    }

    .login-brand-logo {
        width: min(132px, 54%);
    }

    .background-container {
        background:
            radial-gradient(42% 24% at 8% 12%, rgba(99, 130, 242, 0.08), rgba(18, 18, 20, 0)),
            radial-gradient(44% 24% at 92% 84%, rgba(99, 130, 242, 0.06), rgba(18, 18, 20, 0)),
            url("/img/telemix-transparent.png") center 18% / min(44vw, 180px) auto no-repeat,
            url("/img/emd.png") center 86% / min(42vw, 170px) auto no-repeat;
        opacity: 0.055;
    }
}
