/**
 * KeyProxy — вход и регистрация
 */
:root {
    --primary: #3B82F6;
    --accent: #F97316;
    --accent-gradient: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
    --text-main: #0F172A;
    --text-muted: #64748B;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --transition: 0.3s ease;
    --kp-focus: 0 0 0 3px rgba(59, 130, 246, 0.35);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body.kp-auth-login {
    min-height: 100dvh;
    min-height: 100vh;
    background: linear-gradient(135deg, #0F172A 0%, #1E40AF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    overflow-x: hidden;
}

body.kp-auth-register {
    min-height: 100dvh;
    min-height: 100vh;
    background: linear-gradient(135deg, #0F172A 0%, #1E40AF 100%);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.auth-card {
    background: var(--glass-bg);
    width: 100%;
    max-width: 440px;
    padding: clamp(24px, 6vw, 40px);
    border-radius: clamp(18px, 4vw, 24px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 10;
}

body.kp-auth-register .auth-card {
    max-width: 480px;
}

.brand {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
}

.brand span {
    color: var(--accent);
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 30px;
}

.inp {
    width: 100%;
    padding: 16px;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    font-size: 16px;
    background: #F8FAFC;
    margin-bottom: 15px;
    outline: none;
    transition: var(--transition);
    -webkit-appearance: none;
}

body.kp-auth-register .inp {
    margin-bottom: 0;
}

.inp:focus {
    border-color: var(--primary);
    background: white;
}

.inp:focus-visible {
    box-shadow: var(--kp-focus);
}

body.kp-auth-register .inp:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.auth-btn {
    width: 100%;
    padding: 16px 20px;
    min-height: 52px;
    border-radius: 14px;
    border: none;
    background: var(--accent-gradient);
    color: white;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 24px -4px rgba(249, 115, 22, 0.4);
}
.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -4px rgba(249, 115, 22, 0.5);
}
.auth-btn:focus-visible {
    outline: none;
    box-shadow: 0 12px 28px -4px rgba(249, 115, 22, 0.5), var(--kp-focus);
}
.auth-btn:active { transform: translateY(0); }

body.kp-auth-register .auth-btn {
    margin-top: 15px;
    box-shadow: 0 10px 25px -5px rgba(249, 115, 22, 0.4);
}

body.kp-auth-register .auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(249, 115, 22, 0.5);
}

.error-msg {
    background: #FEF2F2;
    color: #DC2626;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #FECACA;
}

.footer-links {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-muted);
}

body.kp-auth-register .footer-links {
    margin-top: 30px;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

/* Регистрация: декор и шапка */
body.kp-auth-register .blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 0;
    animation: kp-auth-float 10s infinite alternate;
    pointer-events: none;
}

body.kp-auth-register .b1 {
    width: 400px;
    height: 400px;
    background: #3B82F6;
    top: -100px;
    right: -100px;
}

body.kp-auth-register .b2 {
    width: 300px;
    height: 300px;
    background: #F97316;
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

@keyframes kp-auth-float {
    from { transform: translate(0, 0); }
    to { transform: translate(-30px, -50px); }
}

.auth-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.logo span {
    color: var(--accent);
}

.back-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.3s;
}

.back-link:hover {
    color: white;
}

.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10;
    margin-top: 60px;
}

.title-block {
    text-align: center;
    margin-bottom: 30px;
}

.title-block h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 5px;
}

.title-block p {
    color: var(--text-muted);
    font-size: 15px;
}

.input-group {
    margin-bottom: 18px;
}

.label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    body.kp-auth-login .auth-btn {
        min-height: 48px;
    }

    body.kp-auth-login .inp {
        font-size: 16px;
        min-height: 48px;
    }

    body.kp-auth-register {
        background: white;
    }

    body.kp-auth-register .blob {
        display: none;
    }

    .auth-header {
        position: relative;
        background: white;
        border-bottom: 1px solid #F1F5F9;
        padding: 15px 20px;
    }

    .auth-header .logo {
        color: var(--text-main);
    }

    .auth-header .back-link {
        color: var(--text-muted);
    }

    .auth-wrapper {
        align-items: flex-start;
        padding: 0;
        margin-top: 0;
    }

    body.kp-auth-register .auth-card {
        box-shadow: none;
        border-radius: 0;
        padding: 30px 20px;
        max-width: 100%;
        min-height: calc(100vh - 70px);
        background: white;
        display: flex;
        flex-direction: column;
    }

    .title-block {
        text-align: left;
        margin-bottom: 30px;
        margin-top: 10px;
    }

    .title-block h2 {
        font-size: 32px;
    }

    body.kp-auth-register .footer-links {
        margin-top: auto;
        padding-bottom: 20px;
    }
}
