/* ═══════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    animation: loginFadeIn 0.6s ease-out;
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.login-panel {
    width: 100%;
    max-width: 380px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
    opacity: 0.6;
}

/* Vault door ASCII art background */
.login-vault-art {
    font-size: 9px;
    line-height: 1.15;
    color: rgba(var(--green-rgb),0.08);
    white-space: pre;
    margin-bottom: 16px;
    pointer-events: none;
    user-select: none;
    overflow: hidden;
}

.login-logo {
    font-size: 28px;
    color: var(--green);
    margin-bottom: 4px;
    text-shadow: 0 0 20px rgba(var(--green-rgb),0.3);
    letter-spacing: 2px;
}

.login-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 28px;
}

.login-btn-enter {
    display: block;
    width: 100%;
    padding: 14px 24px;
    border-radius: 12px;
    background: rgba(var(--green-rgb),0.1);
    border: 1px solid rgba(var(--green-rgb),0.3);
    color: var(--green);
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.login-btn-enter:hover {
    background: rgba(var(--green-rgb),0.18);
    box-shadow: 0 0 16px rgba(var(--green-rgb),0.2);
    text-shadow: 0 0 8px rgba(var(--green-rgb),0.4);
}

.login-btn-enter:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-footer {
    font-size: 10px;
    color: var(--muted);
    margin-top: 20px;
    opacity: 0.5;
    letter-spacing: 1px;
}

/* Auth code display */
.auth-section {
    display: none;
    margin-top: 8px;
}

.auth-section.visible {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-code-box {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.auth-code-label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 8px;
}

.auth-code-value {
    font-size: 24px;
    color: var(--green);
    letter-spacing: 3px;
    text-shadow: 0 0 12px rgba(var(--green-rgb),0.3);
    cursor: pointer;
    user-select: all;
}

.auth-deeplinks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-max, .btn-telegram {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.btn-max {
    background: rgba(0, 150, 255, 0.12);
    border: 1px solid rgba(0, 150, 255, 0.3);
    color: #4db8ff;
}

.btn-max:hover {
    background: rgba(0, 150, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 150, 255, 0.25);
}

.btn-telegram {
    background: rgba(0, 136, 204, 0.12);
    border: 1px solid rgba(0, 136, 204, 0.3);
    color: #29b6f6;
}

.btn-telegram:hover {
    background: rgba(0, 136, 204, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 136, 204, 0.25);
}

.deeplink-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.deeplink-label {
    flex: 1;
    text-align: left;
}

.deeplink-arrow {
    font-size: 16px;
    opacity: 0.6;
    transition: transform 0.15s;
}

.btn-max:hover .deeplink-arrow,
.btn-telegram:hover .deeplink-arrow {
    transform: translateX(3px);
    opacity: 1;
}

.auth-countdown {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px;
    font-family: var(--mono, 'Share Tech Mono', monospace);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.auth-countdown.warning {
    color: var(--red);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    50% { opacity: 0.5; }
}

.auth-manual {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 16px;
}

.auth-manual code {
    color: var(--green);
    font-size: 12px;
}

.auth-status {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--line);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--muted);
    font-size: 11px;
}

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

.auth-tg-widget {
    display: flex;
    justify-content: center;
    min-height: 48px;
    margin-top: 6px;
}

.tg-widget-loading {
    color: var(--muted);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
}

.tg-widget-error {
    color: rgba(var(--red-rgb), 0.85);
    font-size: 12px;
    text-align: center;
    padding: 12px 16px;
    border: 1px dashed rgba(var(--red-rgb), 0.3);
    border-radius: 10px;
    background: rgba(var(--red-rgb), 0.05);
    line-height: 1.5;
}

.tg-widget-note {
    margin-top: 8px;
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    line-height: 1.4;
    opacity: 0.75;
}

.login-primary-section {
    margin: 20px 0 4px;
    text-align: center;
}

.login-primary-title {
    font-size: 14px;
    color: var(--green);
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.login-primary-hint {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.login-secondary-section {
    margin-top: 4px;
    text-align: center;
}

.login-secondary-title {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.auth-first-time-hint {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(var(--amber-rgb),0.06);
    border: 1px dashed rgba(var(--amber-rgb),0.3);
    border-radius: 10px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
}

.auth-first-time-hint code {
    background: rgba(var(--amber-rgb),0.15);
    color: var(--amber);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
}

/* ─── OAuth provider buttons ─── */
.login-oauth-providers {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.btn-oauth {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.btn-oauth:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--green-dim);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-oauth .oauth-icon {
    flex-shrink: 0;
}

.btn-oauth-google {
    border-color: rgba(66, 133, 244, 0.3);
}
.btn-oauth-google:hover {
    border-color: rgba(66, 133, 244, 0.6);
    background: rgba(66, 133, 244, 0.08);
}

.btn-oauth-yandex {
    border-color: rgba(252, 63, 29, 0.3);
}
.btn-oauth-yandex:hover {
    border-color: rgba(252, 63, 29, 0.6);
    background: rgba(252, 63, 29, 0.08);
}

.btn-oauth-vk {
    border-color: rgba(0, 119, 255, 0.3);
}
.btn-oauth-vk:hover {
    border-color: rgba(0, 119, 255, 0.6);
    background: rgba(0, 119, 255, 0.08);
}

[data-theme="light"] .btn-oauth,
[data-theme="sepia"] .btn-oauth {
    background: rgba(0, 0, 0, 0.03);
    color: #333;
}
[data-theme="light"] .btn-oauth:hover,
[data-theme="sepia"] .btn-oauth:hover {
    background: rgba(0, 0, 0, 0.08);
}

@media (max-width: 480px) {
    .login-oauth-providers {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-oauth {
        justify-content: center;
    }
}


/* VK ID SDK widget container */
.login-vk-widget {
    min-height: 44px;
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

