:root {
    --yellow: #FFCC00;
    --brand-black: #000000;
    --brand-white: #FFFFFF;
    --text: rgba(255, 255, 255, 0.92);
    --gray: rgba(255, 255, 255, 0.55);
    --border: rgba(255, 255, 255, 0.12);
    --input-bg: rgba(0, 0, 0, 0.2);
    --success: #34C759;
    --error: #FF453A;
    --pending: #FF9F0A;
    --glass-bg: rgba(20, 25, 35, 0.85);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --backdrop: saturate(180%) blur(24px);
    --card-width: min(100% - 32px, 480px);
    --card-padding: clamp(24px, 5vw, 40px);
    --input-height: clamp(46px, 6vh, 52px);
    --btn-height: clamp(48px, 7vh, 56px);
    --h1-size: clamp(2rem, 5vw + 1rem, 2.5rem);
    --h1-margin: clamp(24px, 4vh, 40px);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    background-color: #000000;
}

html, body {
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: radial-gradient(circle at 70% 20%, #1a2a40 0%, #0d1620 50%, #000000 100%);
    background-attachment: fixed;
    padding-bottom: env(safe-area-inset-bottom);
}

#langSelect, #mobLangSelect, footer {
    display: none;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.wrapper {
    width: 100%;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.login-card {
    width: var(--card-width);
    padding: var(--card-padding);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: clamp(16px, 4vw, 24px);
    animation: fadeInUp 0.6s ease-out 2.8s backwards;
    transition: opacity 0.6s ease;
    position: relative;
    overflow: hidden;
}

.login-card.diving-down {
    animation: diveDown 0.8s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes diveDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100px);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 20%, #1a2a40 0%, #0d1620 50%, #000000 100%);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    animation: removeSplash 0.5s ease-out 2.5s forwards;
}

.splash-logo {
    width: 120px;
    height: auto;
    opacity: 0;
    animation: logoFadeInOut 2.5s ease-in-out forwards;
}

@media (max-width: 768px) and (orientation: portrait), (display-mode: standalone) {
    #splash-screen {
        display: flex;
    }
}

@keyframes logoFadeInOut {
    0% { opacity: 0; transform: scale(0.85); }
    30% { opacity: 1; transform: scale(1); }
    70% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.1); }
}

@keyframes removeSplash {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

h1 {
    font-size: var(--h1-size);
    margin: 0 0 var(--h1-margin) 0;
    text-align: center;
    border-bottom: 4px solid var(--yellow);
    padding-bottom: 10px;
    line-height: 1;
    font-weight: 800;
    display: inline-block;
}

h1 a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

h1 a:hover {
    opacity: 0.8;
}

.christmas-title {
    background: linear-gradient(90deg, #FF3B30, #4CD964, #FFCC00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.ocean-title {
    background: linear-gradient(90deg, #00C6FF, #0072FF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.form-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-group {
    width: 100%;
    margin-bottom: clamp(16px, 3vh, 24px);
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    margin-left: 4px;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

input {
    width: 100%;
    background-color: var(--input-bg);
    color: var(--text);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all .2s;
    appearance: none;
    -webkit-appearance: none;
    height: var(--input-height);
    padding: 0 50px 0 16px;
    font-size: max(16px, 1rem);
}

input:focus {
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.2);
    outline: none;
    background-color: rgba(0, 0, 0, 0.4);
}

.toggle-password {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    width: 60px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gray);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--text);
}

.turnstile-wrapper {
    width: 100%;
    margin-bottom: clamp(16px, 3vh, 24px);
    display: block;
    min-height: 65px;
}

#turnstile-widget {
    width: 100%;
    height: auto;
    margin: 0;
}

.agreement-text {
    font-size: 12px;
    color: var(--gray);
    text-align: left;
    margin-bottom: 20px;
    line-height: 1.5;
    width: 100%;
    padding: 0 4px;
}

.submit-btn {
    width: 100%;
    height: var(--btn-height);
    background: var(--yellow);
    color: var(--brand-black);
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.3);
    margin-top: 10px;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.submit-btn:active {
    transform: scale(0.98);
    opacity: 0.8;
}

.submit-btn:disabled {
    opacity: 0.7;
    transform: none;
    cursor: not-allowed;
}

.error {
    color: var(--error);
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 69, 58, 0.1);
    padding: 10px;
    border-radius: 12px;
    width: 100%;
}

.input-feedback {
    font-size: 12px;
    color: var(--error);
    margin-top: 6px;
    margin-left: 4px;
    font-weight: 600;
    display: none;
}

.top-controls {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top));
    right: 20px;
    z-index: 100;
}

.strength-box {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--border);
    display: none;
}

.strength-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
}

.strength-percent {
    color: var(--text);
}

.progress-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--error);
    transition: width 0.3s ease, background 0.3s ease;
}

.req-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.req-item {
    font-size: 11px;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.req-item i {
    font-size: 10px;
    width: 12px;
    text-align: center;
    opacity: 0.5;
}

.req-item.valid {
    color: var(--text);
}

.req-item.valid i {
    color: var(--success);
    opacity: 1;
}

@media (min-width: 769px) {
    #langSelect {
        display: block;
        width: 56px;
        height: 30px;
        border: none;
        background: transparent;
        color: var(--gray);
        font-size: 10px;
        text-align: center;
        text-align-last: center;
        padding: 0;
        appearance: none;
        cursor: pointer;
    }

    #langSelect:hover {
        color: var(--text);
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }

    #langSelect:focus {
        outline: none;
    }

    footer {
        display: flex;
        width: 100%;
        padding: 20px;
        margin-top: auto;
        border-top: none;
        background: transparent;
        justify-content: center;
        align-items: center;
        position: relative;
    }

    .footer-content {
        font-size: 11px;
        color: #aaaaaa;
        letter-spacing: 1px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 8px;
        line-height: 1.5;
        text-align: center;
        mix-blend-mode: normal;
    }

    .footer-content a {
        color: inherit;
        text-decoration: none;
        font-weight: 500;
    }

    .footer-content a:hover {
        text-decoration: underline;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .login-card {
        width: 60%;
        max-width: 450px;
    }
}

@media (max-width: 768px) {
    #mobLangSelect {
        display: flex;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: var(--glass-bg);
        border: 1px solid var(--border);
        color: var(--text);
        font-size: 16px;
        text-align: center;
        text-align-last: center;
        appearance: none;
        -webkit-appearance: none;
        align-items: center;
        justify-content: center;
    }

    @media (orientation: portrait) {
        #mobLangSelect {
            display: none !important;
        }
    }
}

.hidden {
    display: none !important;
}

.block {
    display: block !important;
}

.strength-weak {
    background-color: var(--error) !important;
}

.strength-medium {
    background-color: var(--pending) !important;
}

.strength-good {
    background-color: var(--yellow) !important;
}

.strength-strong {
    background-color: var(--success) !important;
}

.hidden-accessible {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.input-hint {
    font-size: 11px;
    color: var(--gray);
    margin-top: 4px;
    margin-left: 4px;
    line-height: 1.2;
}

.register-link-wrapper {
    margin-top: 24px;
    text-align: center;
}

.register-link {
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    padding: 10px;
}
