/* Login Page Styles */
#loginSection {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0a0e27 100%);
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
}

#loginSection.active {
    display: flex;
}

.login-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.login-logo h1 {
    color: white;
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#loginSection h2 {
    color: white;
    font-size: 28px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 600;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 40px;
    font-size: 14px;
    line-height: 1.6;
}

.telegram-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.telegram-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* OTP Input Container */
.otp-input-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
    /* Limit container width so inputs scale on small screens */
    width: min(720px, 92%);
    margin-left: auto;
    margin-right: auto;
}

.otp-input {
    /* Make inputs flexible so they fit the container width on smaller screens */
    flex: 1 1 0;
    min-width: 44px;
    max-width: 96px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-align: center;
    /* responsive font-size: shrink when needed */
    font-size: clamp(18px, 3.2vw, 28px);
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    /* match the login card background so boxes blend into the card */
    background: transparent;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    transition: all 0.3s ease;
    outline: none;
}

.otp-input:focus {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.otp-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    -webkit-text-fill-color: rgba(255,255,255,0.3);
}

#loginSection .error-message {
    color: #ff6b6b;
    text-align: center;
    margin-top: 16px;
    min-height: 20px;
    font-size: 14px;
    background: rgba(255, 107, 107, 0.1);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

/* Responsive: prevent OTP inputs from overflowing on narrow/mobile devices */
@media (max-width: 520px) {
    .otp-input-container {
        display: grid;
        grid-template-columns: repeat(6, minmax(44px, 1fr));
        gap: 10px;
        justify-items: center;
        width: 92%;
        margin-left: auto;
        margin-right: auto;
    }

    .otp-input {
        flex: 0 0 auto;
        width: 100%;
        max-width: 84px;
        height: 45px;
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .otp-input-container {
        grid-template-columns: repeat(6, minmax(40px, 1fr));
        gap: 8px;
    }

    .otp-input {
        height: 52px;
        font-size: 18px;
        max-width: 76px;
    }
}
