/* ==========================================================================
   GhostCloud — Authentication surface «Void Pink»
   Стиль синхронизирован с главной (ghostcloud-index.html + gc-landing.css):
   те же токены (--fg-*), шрифты (Vollkorn + Onest), декор (ватермарка GHOST,
   пунктирные кольца, glow, тонкая сетка, плавающие бейджи, пилюли-кнопки).
   Подключается ПОСЛЕ ghostcloud.css и gc-landing.css.
   Страница: /login (ghostcloud-login.html)
   ========================================================================== */

body { padding: 0; }

/* Floating theme toggle — в стиле .fg-theme с главной */
.theme-toggle-float {
    position: fixed; top: 20px; right: 20px; z-index: 100;
    background: rgba(10, 3, 12, 0.6);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--fg-border); color: var(--fg-txm);
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease; font-size: 15px;
}
.theme-toggle-float:hover { border-color: var(--fg-border-h); color: var(--fg-p); transform: rotate(20deg); }
.theme-toggle-float .bi-sun-fill { display: none; }
.theme-toggle-float .bi-moon-fill { display: inline; }
html.light-theme .theme-toggle-float { background: rgba(255, 255, 255, 0.7); }
html.light-theme .theme-toggle-float .bi-sun-fill { display: inline; }
html.light-theme .theme-toggle-float .bi-moon-fill { display: none; }
@media (prefers-color-scheme: light) {
    html:not(.dark-theme) .theme-toggle-float { background: rgba(255, 255, 255, 0.7); }
    html:not(.dark-theme) .theme-toggle-float .bi-sun-fill { display: inline; }
    html:not(.dark-theme) .theme-toggle-float .bi-moon-fill { display: none; }
}

/* --- Shell: two-panel split --- */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(400px, 1.02fr) minmax(420px, 0.98fr);
}

/* --- Art panel: мини-версия hero с главной --- */
.auth-art {
    position: relative; overflow: hidden;
    background: var(--fg-bg2);
    border-right: 1px solid var(--fg-border);
    display: flex; align-items: flex-end; justify-content: center;
    min-height: 100vh;
}

/* Ватермарка GHOST — как на главной */
.auth-watermark {
    position: absolute; top: 44%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-weight: 900; font-size: clamp(110px, 13vw, 190px);
    letter-spacing: -0.04em; line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(224, 48, 110, 0.08);
    user-select: none; pointer-events: none;
    white-space: nowrap;
    z-index: 1;
}
html.light-theme .auth-watermark { -webkit-text-stroke-color: rgba(155, 16, 64, 0.09); }

/* Кольца и glow — центрируем через margin (transform занят анимацией вращения) */
.auth-art .fg-ring-a {
    width: 440px; height: 440px;
    top: 46%; left: 50%; margin: -220px 0 0 -220px;
}
.auth-art .fg-ring-b {
    width: 340px; height: 340px;
    top: 46%; left: 50%; margin: -170px 0 0 -170px;
}
.auth-art-glow {
    position: absolute; top: 46%; left: 50%;
    width: 380px; height: 380px; margin: -190px 0 0 -190px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 48, 110, 0.16) 0%, rgba(180, 30, 80, 0.06) 40%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
}

.auth-art img {
    position: relative; z-index: 2;
    width: min(62%, 440px); max-height: 86vh;
    object-fit: contain; object-position: bottom;
    filter: drop-shadow(0 0 40px rgba(224, 48, 110, 0.35)) drop-shadow(0 0 80px rgba(180, 30, 80, 0.18));
    animation: fg-char-float 5.5s ease-in-out infinite;
}
html.light-theme .auth-art img { filter: drop-shadow(0 12px 34px rgba(155, 16, 64, 0.28)); }

/* Верхний левый блок: eyebrow + дисплейный заголовок (Vollkorn, как fg-h2) */
.auth-art-copy { position: absolute; z-index: 3; left: 55px; top: 48px; color: var(--fg-tx); }
.auth-art-copy strong {
    display: block;
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(34px, 4.2vw, 62px); line-height: 0.98;
    letter-spacing: -0.02em;
}
.auth-art-copy > span {
    display: block; margin-top: 18px;
    font-size: 10px; font-weight: 600; letter-spacing: 0.23em;
    text-transform: uppercase; color: var(--fg-txd);
}

/* Плавающие бейджи — те же .fg-badge с главной, свои позиции */
.auth-badge-1 { top: 16%; right: 9%; }
.auth-badge-2 { bottom: 14%; left: 8%; animation-delay: 1.8s; }

.auth-jp {
    position: absolute; z-index: 3; right: 43px; bottom: 45px;
    writing-mode: vertical-rl;
    color: var(--fg-p);
    font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
}
html.light-theme .auth-jp { color: var(--fg-pd); }

/* --- Form panel --- */
.auth-form-side {
    display: flex; align-items: center; justify-content: center;
    padding: 80px 7vw;
    position: relative;
}
.login-container { max-width: 460px; width: 100%; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.login-header { text-align: left; margin-bottom: 28px; }
.login-logo {
    display: flex; align-items: center; justify-content: flex-start; gap: 12px;
    margin-bottom: 46px; text-decoration: none; color: var(--fg-tx);
}
.login-logo img { width: 42px; height: 42px; }
.login-logo span {
    font-family: var(--font-display); font-size: 24px; font-weight: 700;
    color: var(--fg-logo, var(--fg-tx)); letter-spacing: -0.01em;
}
.login-logo span::after {
    content: ' / PRIVATE ACCESS';
    font-family: var(--font-ui); font-size: 9px; font-weight: 700;
    letter-spacing: 0.16em; color: var(--fg-p); margin-left: 8px;
}
.login-header h1 {
    font-family: var(--font-display); font-weight: 800;
    font-size: 34px; letter-spacing: -0.02em; margin-bottom: 10px;
    color: var(--fg-tx);
}
.login-header p { font-size: 13.5px; color: var(--fg-txm); font-weight: 300; }
.login-header .fg-eyebrow { margin-bottom: 14px; }

/* Карточка формы — панель как на главной (тонкая розовая граница, 16px) */
.login-card, .forgot-block {
    padding: 28px;
    background: var(--fg-card);
    border: 1px solid var(--fg-border);
    border-radius: 16px;
    box-shadow: 0 4px 28px rgba(224, 48, 110, 0.05);
}
html.light-theme .login-card, html.light-theme .forgot-block {
    box-shadow: 0 4px 24px rgba(155, 16, 64, 0.07);
}
.forgot-block { display: none; animation: fadeIn 0.3s ease; margin-top: 16px; border-radius: 12px; }
.forgot-block h3 { font-size: 15px; font-weight: 800; margin-bottom: 6px; color: var(--fg-tx); }
.forgot-block > p { font-size: 13px; color: var(--fg-txm); margin-bottom: 16px; }

.form-group label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em;
    color: var(--fg-txd); font-weight: 600;
}
.form-group input { border-radius: 10px; }
.form-group input:focus {
    border-color: var(--fg-p);
    box-shadow: 0 0 0 3px rgba(224, 48, 110, 0.14);
}

/* Кнопка — пилюля с градиентом, как .fg-btn-fill на главной */
.login-btn {
    width: 100%; padding: 15px;
    background: var(--fg-grad); color: #fff;
    border: none; border-radius: 100px;
    font-family: var(--font-ui); font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.14em;
    cursor: pointer; transition: all 0.25s ease;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: var(--fg-shadow-glow);
}
.login-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--fg-shadow-lift); }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.login-btn .spinner { width: 18px; height: 18px; animation: spin 0.8s linear infinite; display: none; }

.error-msg {
    background: var(--error-bg); border: 1px solid var(--error-border);
    color: var(--error);
    padding: 12px 16px; border-radius: 10px;
    font-size: 13.5px; margin-bottom: 18px;
    display: none; text-align: center;
}
.error-msg.info {
    background: rgba(224, 48, 110, 0.08);
    border-color: rgba(224, 48, 110, 0.3);
    color: var(--fg-txm);
}

.forgot-link { text-align: left; margin-top: 20px; font-size: 13px; }
.forgot-link a { color: var(--fg-p); text-decoration: none; cursor: pointer; font-weight: 600; transition: opacity 0.2s; }
.forgot-link a:hover { opacity: 0.8; }

.forgot-success {
    background: var(--success-bg); border: 1px solid var(--success-border);
    color: var(--success);
    padding: 12px 16px; border-radius: 10px;
    font-size: 13.5px; text-align: center; display: none; margin-bottom: 14px;
}
.forgot-error {
    background: var(--error-bg); border: 1px solid var(--error-border);
    color: var(--error);
    padding: 12px 16px; border-radius: 10px;
    font-size: 13.5px; text-align: center; display: none; margin-bottom: 14px;
}

.login-footer { text-align: left; margin-top: 30px; }
.login-footer a { color: var(--fg-p); text-decoration: none; font-weight: 600; font-size: 14px; transition: opacity 0.2s; }
.login-footer a:hover { opacity: 0.8; }

.register-link {
    text-align: left; margin-top: 0; padding-top: 18px;
    border-top: 1px solid var(--fg-border);
    font-size: 14px; color: var(--fg-txm);
}
.register-link a { color: var(--fg-p); text-decoration: none; font-weight: 700; cursor: pointer; transition: opacity 0.2s; }
.register-link a:hover { opacity: 0.8; }

/* --- Registration modal --- */
.reg-modal {
    display: none; position: fixed; inset: 0; z-index: 200;
    align-items: center; justify-content: center; padding: 20px;
}
.reg-modal.active { display: flex; }
.reg-modal-overlay {
    position: absolute; inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.reg-modal-content {
    position: relative;
    background: var(--modal-bg);
    border: 1px solid var(--fg-border);
    border-radius: 16px;
    padding: 35px;
    max-width: 560px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.reg-modal-close {
    position: absolute; top: 16px; right: 16px;
    background: transparent; border: 1px solid var(--fg-border);
    color: var(--fg-txm); border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.reg-modal-close:hover { border-color: var(--fg-border-h); color: var(--fg-p); }

.reg-modal-head { text-align: left; margin-bottom: 24px; }
.reg-modal-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 26px; margin-bottom: 8px; letter-spacing: -0.02em; color: var(--fg-tx); }
.reg-modal-head p { color: var(--fg-txm); font-size: 13.5px; }
.reg-modal-head strong { color: var(--fg-p); }

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

/* Plan cards */
.reg-plans {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.reg-plan {
    background: var(--fg-card);
    border: 1px solid var(--fg-border); border-radius: 12px;
    padding: 18px 14px; text-align: center;
    cursor: pointer; transition: all 0.2s;
    position: relative;
}
.reg-plan:hover { border-color: var(--fg-border-h); background: var(--bg-card-h); }
.reg-plan.selected {
    background: rgba(224, 48, 110, 0.1);
    border-color: rgba(224, 48, 110, 0.5);
    box-shadow: var(--fg-shadow-glow);
}
.reg-plan-name { font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--fg-tx); }
.reg-plan-price { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--fg-p); }
.reg-plan-price span { font-size: 14px; font-weight: 500; color: var(--fg-txd); font-family: var(--font-ui); }
.reg-plan-badge {
    position: absolute; top: 8px; right: 8px;
    background: var(--fg-grad); color: #fff;
    font-size: 9px; font-weight: 800; letter-spacing: 0.06em;
    padding: 3px 8px; border-radius: 100px;
    text-transform: uppercase;
}

.reg-email-warn {
    background: var(--error-bg); border: 1px solid var(--error-border);
    border-radius: 10px;
    padding: 14px; margin-bottom: 16px;
    display: none; font-size: 13px; color: var(--error); line-height: 1.5;
}
.reg-email-warn a { color: var(--fg-p); text-decoration: none; font-weight: 700; }

.form-hint { display: block; font-size: 12px; color: var(--fg-txd); margin-top: 6px; }

.reg-verify-block { margin-top: 10px; }
.reg-verify-block p { font-size: 13px; color: var(--fg-txm); margin: 0 0 8px; line-height: 1.5; }
.reg-verify-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.reg-verify-input {
    flex: 1; min-width: 120px; padding: 11px 12px;
    border-radius: 10px; border: 1px solid var(--input-border);
    background: var(--bg-elevated); color: var(--fg-tx);
    font-family: inherit; font-size: 15px; letter-spacing: 0.2em;
}
.reg-verify-input:focus { outline: none; border-color: var(--fg-p); }
.reg-confirm-btn {
    padding: 0 16px; border-radius: 100px;
    background: rgba(224, 48, 110, 0.14); color: var(--fg-p);
    border: 1px solid rgba(224, 48, 110, 0.35);
    font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: background 0.2s;
}
.reg-confirm-btn:hover { background: rgba(224, 48, 110, 0.26); }
.reg-confirm-btn .spinner { width: 15px; height: 15px; animation: spin 0.8s linear infinite; display: none; }
.reg-wrong-link {
    margin-top: 10px; background: none; border: none;
    color: var(--fg-txd); font-size: 12.5px; cursor: pointer;
    text-decoration: underline; padding: 0; font-family: inherit;
}
.reg-wrong-link:hover { color: var(--fg-txm); }
.reg-verified { display: none; margin-top: 8px; font-size: 13px; color: var(--success); }
.reg-verified button {
    background: none; border: none; color: var(--fg-p); font-size: 12.5px;
    cursor: pointer; text-decoration: underline; padding: 0; margin-left: 6px; font-family: inherit;
}
.reg-sent-hint { display: none; margin-top: 8px; font-size: 13px; color: var(--success); line-height: 1.5; }

.reg-promo-label {
    display: flex; align-items: center; gap: 6px; cursor: pointer;
    font-size: 13px; font-weight: 600; color: var(--fg-p);
}
.reg-promo-label i { font-size: 14px; }
.reg-promo-wrap { display: none; margin-top: 6px; }
.reg-promo-row { display: flex; gap: 8px; align-items: stretch; }
.reg-promo-input {
    flex: 1; padding: 10px 12px; text-transform: uppercase;
    border-radius: 10px; border: 1px solid var(--input-border);
    background: var(--input-bg); color: var(--fg-tx); font-family: inherit; font-size: 14px;
}
.reg-promo-input:focus { outline: none; border-color: var(--fg-p); }
.reg-promo-apply {
    background: rgba(224, 48, 110, 0.13); color: var(--fg-p);
    border: 1px solid rgba(224, 48, 110, 0.3); border-radius: 100px;
    padding: 0 16px; font-size: 12px; font-weight: 700;
    display: inline-flex; align-items: center;
    white-space: nowrap; cursor: pointer; transition: background 0.2s;
}
.reg-promo-apply:hover { background: rgba(224, 48, 110, 0.25); }
.reg-promo-result { margin-top: 6px; font-size: 13px; display: none; }

.reg-back-btn {
    background: none; border: none; color: var(--fg-txm);
    font-size: 13px; margin-top: 14px; cursor: pointer;
    width: 100%; text-align: center; font-family: inherit; font-weight: 600;
    transition: color 0.2s;
}
.reg-back-btn:hover { color: var(--fg-tx); }

.reg-secure {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 14px; font-size: 12px; color: var(--fg-txd);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
    .auth-form-side { padding: 70px 5vw; }
}

@media (max-width: 900px) {
    /* Art panel превращается в компактный брендовый блок сверху */
    .auth-shell { grid-template-columns: 1fr; }
    .auth-art {
        min-height: 250px; height: 250px;
        border-right: 0; border-bottom: 1px solid var(--fg-border);
        align-items: center; justify-content: flex-end;
        overflow: hidden;
    }
    .auth-watermark { font-size: clamp(80px, 20vw, 130px); top: 42%; }
    .auth-art .fg-ring-a { width: 300px; height: 300px; margin: -150px 0 0 -150px; top: 44%; }
    .auth-art .fg-ring-b { width: 230px; height: 230px; margin: -115px 0 0 -115px; top: 44%; }
    .auth-art-glow { width: 260px; height: 260px; margin: -130px 0 0 -130px; top: 44%; }
    .auth-art img { width: auto; height: 225px; max-height: 225px; margin-right: 16vw; }
    .auth-art-copy { left: 28px; top: 30px; max-width: 48%; }
    .auth-art-copy strong { font-size: 32px; }
    .auth-art-copy > span { margin-top: 10px; font-size: 9px; letter-spacing: 0.14em; }
    .auth-art-copy .fg-eyebrow { margin-bottom: 10px; }
    .auth-badge-1, .auth-badge-2 { display: none; }
    .auth-jp { display: none; }
    .theme-toggle-float { top: 24px; right: 24px; }

    .auth-form-side { min-height: 0; padding: 48px 24px 60px; }
    .login-logo { margin-bottom: 34px; }
    .login-header h1 { font-size: 28px; }
    .login-card, .forgot-block { padding: 22px; }
    .login-footer { margin-top: 24px; }
}

@media (max-width: 480px) {
    .reg-plans { grid-template-columns: 1fr; }
    .reg-modal-content { padding: 26px 18px; }
    .theme-toggle-float { top: 18px; right: 18px; width: 40px; height: 40px; }
    .auth-art { height: 220px; min-height: 220px; }
    .auth-art img { height: 200px; max-height: 200px; margin-right: 20vw; }
    .auth-art-copy { max-width: 46%; }
    .auth-art-copy strong { font-size: 26px; }
    .auth-art-copy > span { white-space: normal; line-height: 1.7; }
    .login-header h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .login-container, .forgot-block, .reg-modal-content { animation: none; }
    .auth-art img { animation: none; }
    .auth-art .fg-ring-a, .auth-art .fg-ring-b { animation: none; }
}

/* Вторичная кнопка "Вход по 2FA" — контурная, под основной */
.login-btn-2fa {
    margin-top: 10px;
    background: transparent;
    color: var(--fg-p);
    border: 1.5px solid var(--fg-p);
    box-shadow: none;
}
.login-btn-2fa:hover:not(:disabled) { transform: translateY(-2px); box-shadow: none; opacity: 0.85; }
