/* ===== БАЗОВЫЕ СБРОСЫ И ФОН ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background: #0A0A10;
    color: #FFFFFF;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Корневые переменные */
        :root {
            --primary: #db939d;
            --primary-dark: #4f46e5;
            --primary-light: #818cf8;
            --secondary: #cc7e7e;
            --accent: rgba(180, 30, 30, 0.8);
            --dark: #0f172a;
            --darker: #020617;
            --light: #f8fafc;
            --border: rgba(255, 255, 255, 0.08);
            --border-light: rgba(255, 255, 255, 0.12);
            --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            --gradient-accent: linear-gradient(135deg, var(--accent) 0%, #df7373 100%);
        }
        /* ===== ПРЕЛОАДЕР (как на главной) ===== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0A0A10;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.65, 0, 0.35, 1), visibility 0.8s;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-ring {
    width: 60px;
    height: 60px;
    margin: 0 auto 30px;
    position: relative;
}

.loader-ring::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid #CE1E1E;
    border-right: 3px solid #CE1E1E;
    border-radius: 50%;
    animation: spinLoader 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.loader-ring::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    border: 2px solid transparent;
    border-bottom: 2px solid rgba(206, 30, 30, 0.4);
    border-left: 2px solid rgba(206, 30, 30, 0.4);
    border-radius: 50%;
    animation: spinLoader 1.8s linear infinite reverse;
}

@keyframes spinLoader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-logo-text {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 6px;
    color: #FFFFFF;
    animation: textPulseLoader 2s ease-in-out infinite;
}

@keyframes textPulseLoader {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

#firefly {
        position: fixed;
        width: 1px; height: 1px;
        transform: translate(-50%, -50%);
        border-radius: 50%;
        background: radial-gradient(circle at 30% 30%, #dc143c, #4a0f0f);
        box-shadow: 0 0 20px 8px rgba(180,30,30,0.8), 0 0 40px 15px rgba(80,80,80,0.5), 0 0 60px 25px rgba(60,20,20,0.3);
        pointer-events: none;
        transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
        z-index: 9999;
        animation: flicker 0.12s infinite alternate;
    }

    @keyframes flicker {
        0% { opacity: 0.85; transform: translate(-50%, -50%) scale(0.95); }
        50% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.05); }
        100% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
    }

    #firefly.on-link {
        width: 1px; height: 1px;
        background: radial-gradient(circle at 30% 30%, #ff4444, #8b0000);
        box-shadow: 0 0 30px 15px rgba(200,30,30,0.9), 0 0 60px 25px rgba(100,100,100,0.6), 0 0 80px 35px rgba(60,15,15,0.5);
        animation: flicker-intense 0.1s infinite alternate;
    }

    @keyframes flicker-intense {
        0% { opacity: 0.8; transform: translate(-50%, -50%) scale(0.9); }
        100% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    }

    #trail-canvas {
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        pointer-events: none;
        z-index: 9998;
    }


    /* Авторизация */
    .graze-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 32px;
    box-shadow: 0 25px 45px -10px rgba(0, 20, 40, 0.25);
    width: 100%;
    max-width: 460px;
    padding: 30px 28px 36px;
    margin: 20px auto;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.25s ease;
    animation: cardFade 0.5s ease-out;
}

@keyframes cardFade {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

.graze-nav {
    display: flex;
    align-items: center;
    margin-bottom: 22px;
}

.graze-back {
    background: transparent;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px 12px 8px 6px;
    border-radius: 40px;
    transition: background 0.15s, color 0.15s;
    font-family: 'Poppins', system-ui, sans-serif;
}

.graze-back i {
    font-size: 22px;
    color: #94a3b8;
}

.graze-back:hover {
    background: rgba(254, 58, 58, 0.08);
    color: #94a3b8;
}

.graze-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 6px;
    font-family: 'Poppins', sans-serif;
}

.graze-switch-row {
    font-size: 15px;
    color: #94a3b8;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.graze-switch-btn {
    background: none;
    border: none;
    color: #3a7afe;
    font-weight: 600;
    font-size: 15px;
    margin-left: 8px;
    cursor: pointer;
    padding: 4px 0;
    border-bottom: 1.5px dashed #3a7afe;
}

.graze-switch-btn:hover {
    color: #1f5be0;
    border-bottom-style: solid;
}

.graze-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-field label {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrapper > i:first-child {
    position: absolute;
    left: 16px;
    color: #8599b9;
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
}

.graze-input {
    width: 100%;
    padding: 14px 48px 14px 48px;
    font-size: 15px;
    border: 1.5px solid #e2e8f2;
    border-radius: 18px;
    background: #ffffff;
    transition: border 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
    color: #0f1e32;
}

.graze-input:focus {
    outline: none;
    border-color: #3a7afe;
    box-shadow: 0 0 0 4px rgba(58, 122, 254, 0.12);
}

.password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: #6d85a6;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 24px;
    height: 24px;
    z-index: 2;
}

.password-toggle i {
    font-size: 20px;
    color: #6d85a6;
    pointer-events: none;
}

.password-toggle:hover i {
    color: #3a7afe;
}

.select-row {
    display: flex;
    gap: 12px;
}

.select-wrapper {
    flex: 1;
    position: relative;
}

.select-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8599b9;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.graze-select {
    width: 100%;
    padding: 14px 12px 14px 44px;
    font-size: 15px;
    border: 1.5px solid #e2e8f2;
    border-radius: 18px;
    background: white;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    color: #0f1e32;
}

.select-chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8599b9;
    font-size: 18px;
    pointer-events: none;
}

.graze-submit {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 16px 20px;
    font-size: 17px;
    font-weight: 600;
    border-radius: 40px;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 8px 18px -6px rgba(180, 30, 30, 0.8);
    font-family: 'Inter', sans-serif;
}

.graze-submit:hover {
    background: var(--gradient-accent);
    box-shadow: 0 10px 22px -8px var(--gradient-accent);
}

.forgot-link {
    text-align: right;
    margin-top: -6px;
}

.forgot-link a {
    color: #3a7afe;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
}

.terms-text {
    font-size: 13px;
    color: #6a7f9e;
    text-align: center;
    margin-top: 24px;
}

.terms-text a {
    color: #6a7f9e;
    font-weight: 600;
    text-decoration: none;
}

.error-message {
    color: #e03a3a;
    font-size: 13px;
    margin-top: 4px;
    min-height: 18px;
}

.hidden {
    display: none !important;
}