:root {
    --bg:          #0a0a0b;
    --bg-2:        #0e0d10;
    --surface:     rgba(255,255,255,0.04);
    --border:      rgba(255,255,255,0.08);
    --border-hover:rgba(255,255,255,0.16);
    --accent:      #ff5a25;
    --accent2:     #e01e0f;
    --accent-dim:  rgba(255,90,37,0.18);
    --accent-glow: rgba(255,90,37,0.35);
    --text-1:      #f4f2ef;
    --text-2:      #b8b5ad;
    --text-3:      #7d7a73;
    --success:     #4cd964;
    --warning:     #ffcc00;
}

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

html, body {
    width: 100%; height: 100%;
    background: var(--bg);
    font-family: 'Manrope', sans-serif;
    color: var(--text-1);
    overflow: hidden;
}

.bg-layer {
    position: fixed; inset: 0; z-index: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 20%, rgba(255,90,37,0.10) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 80%, rgba(224,30,15,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 30% 30% at 50% 50%, rgba(255,90,37,0.03) 0%, transparent 70%);
    animation: bgPulse 8s ease-in-out infinite;
}
@keyframes bgPulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.7; }
}

.bg-grid {
    position: fixed; inset: 0; z-index: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}

.particle {
    position: fixed; border-radius: 50%;
    background: var(--accent);
    opacity: 0;
    animation: float linear infinite;
    z-index: 0;
    pointer-events: none;
}
@keyframes float {
    0%   { transform: translateY(110vh) scale(0); opacity: 0; }
    10%  { opacity: 0.4; }
    90%  { opacity: 0.15; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.page {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

.card-wrap {
    width: 100%; max-width: 420px;
    animation: cardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(32px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.logo-block {
    text-align: center;
    margin-bottom: 36px;
    animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}
.logo-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,90,37,0.2), rgba(224,30,15,0.06));
    border: 1px solid rgba(255,90,37,0.3);
    margin-bottom: 18px;
    box-shadow: 0 0 30px rgba(255,90,37,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}
.logo-icon::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent);
    border-radius: inherit;
}
.logo-icon i {
    font-size: 26px;
    color: var(--accent);
    filter: drop-shadow(0 0 8px rgba(255,90,37,0.5));
}
.logo-title {
    font-family: 'Sora', sans-serif;
    font-size: 26px; font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.6) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-sub {
    font-size: 12px; font-weight: 500; letter-spacing: 2.5px;
    color: var(--accent); text-transform: uppercase;
    margin-top: 4px; opacity: 0.8;
}

.form-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px 28px;
    backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.02) inset,
        0 32px 64px rgba(0,0,0,0.5),
        0 0 80px rgba(255,90,37,0.05);
    animation: cardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.form-title {
    font-family: 'Sora', sans-serif;
    font-size: 18px; font-weight: 700;
    color: var(--text-1); margin-bottom: 4px;
}
.form-desc {
    font-size: 13px; color: var(--text-3);
    margin-bottom: 28px; line-height: 1.5;
}

.input-group {
    margin-bottom: 16px;
}
.input-label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: var(--text-2); letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.input-wrap {
    position: relative;
}
.input-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-3); font-size: 14px;
    pointer-events: none;
    transition: color 0.2s;
}
.form-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 14px 14px 42px;
    color: var(--text-1);
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    transition: all 0.25s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.form-input::placeholder { color: var(--text-3); }
.form-input:focus {
    border-color: var(--accent);
    background: rgba(255,90,37,0.05);
    box-shadow: 0 0 0 3px rgba(255,90,37,0.12);
}
.form-input:focus + .input-icon,
.input-wrap:focus-within .input-icon {
    color: var(--accent);
}

.input-wrap .form-input { order: 2; }
.input-wrap .input-icon { order: 1; }

.pw-toggle {
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--text-3); cursor: pointer;
    font-size: 14px; padding: 4px;
    transition: color 0.2s;
}
.pw-toggle:hover { color: var(--text-2); }

.error-box {
    display: none;
    background: rgba(255,90,37,0.08);
    border: 1px solid rgba(255,90,37,0.2);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px; color: var(--accent);
    line-height: 1.4;
    animation: shake 0.4s ease;
}
.error-box.visible { display: flex; gap: 8px; align-items: flex-start; }
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%,60%  { transform: translateX(-4px); }
    40%,80%  { transform: translateX(4px); }
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff5a25 0%, #e01e0f 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: 15px; font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(255,90,37,0.3), 0 1px 0 rgba(255,255,255,0.1) inset;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    position: relative; overflow: hidden;
    margin-top: 8px;
}
.submit-btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    opacity: 0; transition: opacity 0.2s;
}
.submit-btn:hover::before { opacity: 1; }
.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(255,90,37,0.4), 0 1px 0 rgba(255,255,255,0.1) inset;
}
.submit-btn:active { transform: translateY(0) scale(0.99); }
.submit-btn:disabled {
    opacity: 0.5; cursor: not-allowed;
    transform: none; box-shadow: none;
}

.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider {
    display: flex; align-items: center; gap: 12px;
    margin: 24px 0;
}
.divider-line {
    flex: 1; height: 1px;
    background: var(--border);
}
.divider-text {
    font-size: 11px; color: var(--text-3);
    letter-spacing: 1px; text-transform: uppercase;
    white-space: nowrap;
}

.footer-note {
    margin-top: 24px;
    text-align: center;
    font-size: 12px; color: var(--text-3);
    line-height: 1.6;
    animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}
.footer-note a {
    color: var(--accent); text-decoration: none;
    opacity: 0.8; transition: opacity 0.2s;
}
.footer-note a:hover { opacity: 1; }

.server-badges {
    display: flex; gap: 8px; justify-content: center;
    margin-top: 12px;
}
.badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 1px;
}
.badge-spb  { background: rgba(47,155,245,0.12); color: #2f9bf5; border: 1px solid rgba(47,155,245,0.22); }
.badge-surg { background: rgba(155,123,255,0.12); color: #9b7bff; border: 1px solid rgba(155,123,255,0.22); }
.badge-black { background: rgba(255,90,37,0.12); color: #ff5a25; border: 1px solid rgba(255,90,37,0.22); }

.success-state {
    display: none;
    text-align: center; padding: 20px 0;
    animation: cardIn 0.4s ease both;
}
.success-state.visible { display: block; }
.success-icon {
    font-size: 48px; margin-bottom: 14px;
    filter: drop-shadow(0 0 12px rgba(76,217,100,0.4));
}

.vk-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%;
    padding: 16px;
    background: rgba(0, 119, 255, 0.12);
    border: 1px solid rgba(0, 119, 255, 0.3);
    border-radius: 14px;
    color: #5b9bd5;
    font-family: 'Sora', sans-serif;
    font-size: 15px; font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 119, 255, 0.1);
    margin-top: 4px;
}
.vk-btn:hover {
    background: rgba(0, 119, 255, 0.2);
    border-color: rgba(0, 119, 255, 0.5);
    color: #7ab3e8;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 119, 255, 0.2);
}
.vk-btn:active { transform: translateY(0) scale(0.99); }

#tg-login-btn.tg-login-btn {
    width: 100% !important;
    box-sizing: border-box;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 999px;
    background: #2aabee;
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: 16px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(42,171,238,0.35);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
#tg-login-btn.tg-login-btn:hover { background: #229ed9; transform: translateY(-1px); box-shadow: 0 8px 26px rgba(42,171,238,0.45); }
#tg-login-btn.tg-login-btn:active { transform: translateY(0) scale(0.99); }
#tg-login-btn.tg-login-btn:disabled { opacity: .6; cursor: wait; transform: none; }
.tg-login-note {
    margin-top: 12px;
    font-size: 12px; line-height: 1.45;
    color: var(--text-3);
    text-align: center;
}
