/* Экран входа/регистрации для веб-версии (app.geminiborus.com).
   Отдельный файл — не нужен Mini App, поэтому не грузится в Telegram. */

/* Разметка внутри рассчитана на мобильный экран (Telegram Mini App
   всегда открывается в узком webview). На широком десктопе центрируем
   всё в колонку телефонного размера вместо растягивания на всю ширину.
   transform создаёт containing block и для fixed-элементов тоже —
   поэтому шапка/таб-бар/модалки не вылезают за пределы рамки. */
@media (min-width: 700px) {
    body { background: #05060d; }

    #app-frame {
        max-width: 480px;
        min-height: 100vh;
        margin: 0 auto;
        position: relative;
        transform: translateZ(0);
        box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
    }
}

#auth-gate {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1a1a2e, #16213e, #0f3460);
    padding: 20px;
}

.auth-card {
    background: rgba(20, 20, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border-radius: 35px;
    padding: 36px 28px;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.auth-card h1 {
    color: #FFD700;
    font-size: 24px;
    margin: 0 0 6px 0;
}

.auth-card .auth-subtitle {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    margin-bottom: 24px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.auth-tab.active {
    background: var(--accent);
    color: #1a1a2e;
}

.auth-input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: white;
    font-size: 15px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.auth-input:focus {
    border-color: var(--accent);
}

.auth-input.code-input {
    text-align: center;
    letter-spacing: 8px;
    font-size: 22px;
    font-weight: 700;
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 16px;
    background: var(--accent);
    color: #1a1a2e;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    margin-top: 4px;
    transition: transform 0.15s;
}

.auth-submit-btn:active { transform: scale(0.97); }

.auth-submit-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.auth-link-btn {
    background: none;
    border: none;
    color: #00E5FF;
    font-size: 13px;
    cursor: pointer;
    margin-top: 14px;
    text-decoration: underline;
}

.auth-error {
    color: #FF5C5C;
    font-size: 13px;
    margin: 8px 0;
    min-height: 16px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: rgba(255,255,255,0.35);
    font-size: 12px;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

#telegram-login-widget-container {
    display: flex;
    justify-content: center;
}

.auth-step { display: none; }
.auth-step.active { display: block; }
