/* =========================================
   УНІВЕРСАЛЬНИЙ МІНІМАЛІСТИЧНИЙ ДИЗАЙН АВТОРИЗАЦІЇ
   ========================================= */
::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
* { -ms-overflow-style: none !important; scrollbar-width: none !important; }

.top-spacing { height: 40px; }
.full-width { width: 100% !important; box-sizing: border-box; }

.modern-auth-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}

.modern-auth-wrapper {
    position: relative;
    width: 100%;
    max-width: 460px; /* Ідеальна ширина для логіну */
    z-index: 2;
}

.modern-auth-wrapper.register-wrapper {
    max-width: 580px; /* Для реєстрації робимо трохи ширше */
}

/* Фонове світіння */
.modern-auth-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130%;
    height: 130%;
    background: radial-gradient(circle at center, rgba(79, 70, 229, 0.15) 0%, transparent 65%);
    z-index: -1;
    pointer-events: none;
    filter: blur(40px);
}

.modern-auth-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 45px 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
    .modern-auth-card { background: rgba(30, 41, 59, 0.85); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4); }
    .modern-auth-glow { background: radial-gradient(circle at center, rgba(79, 70, 229, 0.25) 0%, transparent 65%); }
}

/* Шапка */
.modern-auth-head { text-align: center; margin-bottom: 25px; width: 100%; }
.modern-auth-icon-badge {
    width: 56px; height: 56px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 15px;
}
.modern-auth-head h2 { font-size: 1.8rem; font-weight: 900; color: var(--text-main); margin: 0 0 8px 0; }
.modern-text-muted { color: var(--text-muted); font-size: 0.95rem; margin: 0; line-height: 1.5; }

/* Кнопка Google */
.google-btn {
    background: #ffffff !important;
    color: #333 !important;
    border: 1px solid #e5e7eb !important;
    font-weight: 700 !important;
    margin-bottom: 20px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 24px; border-radius: 14px; text-decoration: none; transition: var(--transition);
}
.google-btn:hover { background: #f8fafc !important; border-color: #d1d5db !important; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
@media (prefers-color-scheme: dark) {
    .google-btn { background: rgba(255,255,255,0.05) !important; color: #fff !important; border-color: rgba(255,255,255,0.1) !important; }
    .google-btn:hover { background: rgba(255,255,255,0.1) !important; border-color: rgba(255,255,255,0.2) !important; }
}

/* Розділювач */
.modern-auth-divider { display: flex; align-items: center; text-align: center; margin: 10px 0 25px 0; color: var(--text-muted); width: 100%; }
.modern-auth-divider::before, .modern-auth-divider::after { content: ""; flex: 1; border-bottom: 1px dashed var(--border-color); }
.modern-auth-divider span { padding: 0 14px; font-size: 0.8rem; text-transform: uppercase; font-weight: 800; }

/* Форма та інпути (Floating Labels) */
.modern-form-element { width: 100%; }
.modern-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; width: 100%; }
.modern-input-wrapper { position: relative; margin-bottom: 20px; background: var(--bg-color); border-radius: 14px; width: 100%; }

.modern-input-field {
    width: 100%; padding: 24px 18px 8px 18px;
    background: transparent; border: 1px solid var(--border-color); border-radius: 14px;
    color: var(--text-main); font-family: inherit; font-size: 1.05rem; font-weight: 600;
    transition: var(--transition); box-sizing: border-box;
}
.modern-input-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }

.modern-label-placeholder {
    position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem; font-weight: 500;
}

.modern-input-field:focus + .modern-label-placeholder,
.modern-input-field:not(:placeholder-shown) + .modern-label-placeholder,
.modern-input-field:-webkit-autofill + .modern-label-placeholder,
.modern-input-field.has-value + .modern-label-placeholder {
    top: 12px; transform: translateY(0); font-size: 0.72rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px;
}

/* Фікс автозаповнення Chrome */
.modern-input-field:-webkit-autofill,
.modern-input-field:-webkit-autofill:hover, 
.modern-input-field:-webkit-autofill:focus, 
.modern-input-field:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 40px var(--bg-color) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
    border-color: var(--accent);
    font-size: 1.05rem !important; font-family: inherit !important; font-weight: 600 !important;
}
.modern-input-field:-webkit-autofill::first-line { font-size: 1.05rem !important; font-family: 'Manrope', sans-serif !important; font-weight: 600 !important; }

/* Чекбокси */
.custom-checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin-bottom: 15px; }
.custom-checkbox input { display: none; }
.checkmark { width: 22px; height: 22px; border: 2px solid var(--border-color); border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--bg-color); transition: var(--transition); }
.custom-checkbox input:checked + .checkmark { background: var(--accent); border-color: var(--accent); }
.custom-checkbox input:checked + .checkmark::after { content: "✔"; color: #fff; font-size: 12px; }
.check-text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.4; }
.check-text a { color: var(--accent); font-weight: 700; text-decoration: underline; }

/* Опції під логіном */
.auth-row-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; width: 100%; }
.forgot-link { color: var(--accent); font-size: 0.95rem; font-weight: 700; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

/* Кнопки */
.modern-btn-submit {
    background: var(--accent); color: #fff !important; border: none; padding: 16px 24px; border-radius: 14px;
    font-size: 1rem; font-weight: 800; cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px;
    display: inline-flex; align-items: center; justify-content: center; transition: var(--transition);
}
.modern-btn-submit:hover { transform: translateY(-2px); background: var(--accent-hover); box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3); }

.modern-btn-secondary {
    background: var(--bg-color); border: 1px solid var(--border-color); color: var(--text-main);
    padding: 15px 24px; border-radius: 14px; font-size: 0.98rem; font-weight: 700; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; transition: var(--transition);
}
.modern-btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: rgba(79, 70, 229, 0.05); }

/* Алерти */
.modern-auth-alert { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 12px; margin-bottom: 20px; font-size: 0.9rem; font-weight: 600; width: 100%; box-sizing: border-box; }
.modern-auth-alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.modern-auth-alert.error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: var(--color-error); }
.modern-auth-alert.success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--color-success); }

/* Модальне вікно (Деактивований акаунт) */
.account-disabled-modal { position: fixed; inset: 0; z-index: 9999; opacity: 0; visibility: hidden; pointer-events: none; transition: 0.3s; }
.account-disabled-modal.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.account-disabled-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); }
.account-disabled-dialog { position: relative; z-index: 2; width: min(92vw, 420px); margin: 10vh auto 0; background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 24px; padding: 30px; text-align: center; transform: translateY(20px); transition: 0.3s; }
.account-disabled-modal.is-open .account-disabled-dialog { transform: translateY(0); }
.account-disabled-close { position: absolute; top: 15px; right: 15px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg-color); color: var(--text-muted); font-size: 20px; cursor: pointer; }
.account-disabled-icon { width: 60px; height: 60px; border-radius: 16px; background: rgba(239, 68, 68, 0.1); color: var(--color-error); display: flex; align-items: center; justify-content: center; margin: 0 auto 15px; }

/* Адаптація */
@media (max-width: 640px) {
    .modern-auth-section { padding: 20px 15px; }
    .modern-auth-card { padding: 35px 20px; border: none; background: transparent; box-shadow: none; backdrop-filter: none; }
    .modern-auth-glow { display: none; }
    .modern-row-2 { grid-template-columns: 1fr; gap: 0; }
}