/* Модальное окно входа/регистрации (как на главной в каталоге) */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2147483640; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
/* Оферта при регистрации — поверх окна входа (см. includes/auth_modal.php) */
.auth-rules-overlay { z-index: 2147483646 !important; }
.modal-overlay.open { display: flex; }
.auth-modal .modal-box { max-width: 400px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; background: var(--card, #1a2332); color: #e6edf3; --bg: #0f1419; --card: #1a2332; --border: #2d3a4d; --text: #e6edf3; --muted: #a0aec0; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); padding: 10px; box-sizing: border-box; width: 100%; }
.auth-modal .modal-head { border-bottom: 1px solid var(--border); padding: 8px 4px; display: flex; align-items: center; gap: 8px; }
.auth-modal .modal-head h2 { color: #fff; margin: 0; font-size: 1rem; }
.auth-modal .modal-close { background: rgba(255,255,255,0.1); color: #fff; border: none; border-radius: 8px; width: 36px; height: 36px; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; margin-left: auto; }
.auth-modal .modal-close:hover { background: var(--accent, #e8b923); color: #0f1419; }
.auth-modal .auth-modal-logout { background: rgba(255,255,255,0.1); color: #fff; border-radius: 8px; width: 36px; height: 36px; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; flex-shrink: 0; }
.auth-modal .auth-modal-logout:hover { background: var(--accent, #e8b923); color: #0f1419; }
.auth-modal .auth-tabs { display: flex; border-bottom: 1px solid var(--border); }
.auth-modal .auth-tabs a { flex: 1; padding: 8px; text-align: center; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; border-bottom: 3px solid transparent; }
.auth-modal .auth-tabs a:hover { color: #fff; }
.auth-modal .auth-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-modal .auth-pane { display: none; padding: 12px 10px; overflow-y: auto; flex: 1; min-height: 0; max-height: 65vh; }
.auth-modal .auth-pane.active { display: block; }
.auth-modal .auth-subtabs { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border, #2d3a4d); padding-bottom: 6px; }
.auth-modal .auth-subtabs a { flex: 0 0 auto; padding: 6px 10px; color: var(--muted, #a0aec0); text-decoration: none; font-weight: 600; font-size: 0.85rem; border-radius: 6px; }
.auth-modal .auth-subtabs a:hover { color: #fff; }
.auth-modal .auth-subtabs a.active { color: var(--accent, #e8b923); background: rgba(232,185,35,0.15); }
.auth-modal .auth-subpane { display: none; }
.auth-modal .auth-subpane.active { display: block; }
.auth-modal .form-group { margin-bottom: 8px; }
.auth-modal .form-group label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 0.82rem; }
.auth-modal .form-group input { width: 100%; padding: 6px 10px; font-size: 0.9rem; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; -webkit-text-fill-color: var(--text); box-sizing: border-box; }
.auth-modal .form-group input::placeholder { color: var(--muted); opacity: 0.8; }
.auth-modal .phone-prefix-wrap { position: relative; }
.auth-modal .phone-prefix-wrap .phone-prefix-select {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    max-width: 130px;
    padding: 2px 20px 2px 4px;
    font-size: 0.8rem;
    background: transparent;
    border: none;
    color: var(--muted);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}
.auth-modal .phone-prefix-wrap input[name="whatsapp_phone_local"] {
    padding-left: 120px;
}
.auth-modal .auth-password-wrap { position: relative; }
.auth-modal .auth-password-wrap input { padding-right: 40px; caret-color: transparent; }
.auth-modal .auth-toggle-password { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; padding: 0; border: none; background: none; color: #e6edf3; cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-modal .auth-toggle-password:hover { color: var(--accent, #e8b923); }
.auth-modal .auth-toggle-password svg { width: 18px; height: 18px; display: block; }
.auth-modal .auth-toggle-password .icon-hide { display: none; }
.auth-modal .auth-toggle-password.visible .icon-show { display: none; }
.auth-modal .auth-toggle-password.visible .icon-hide { display: block; }
.auth-modal .form-error { background: rgba(231,76,60,0.2); border: 1px solid #e74c3c; color: #ff8a80; padding: 6px 10px; border-radius: 8px; margin-bottom: 8px; font-size: 0.82rem; }
.auth-modal .btn-block { width: 100%; padding: 8px; margin-top: 4px; font-size: 0.9rem; border-radius: 8px; font-weight: 700; border: none; cursor: pointer; }
.auth-modal .btn-primary { background: var(--accent, #e8b923); color: #0f1419; }
.auth-modal .auth-link { text-align: center; margin-top: 10px; color: var(--muted); font-size: 0.85rem; }
.auth-modal .auth-link a { color: var(--accent); text-decoration: none; }
.auth-modal .auth-link a:hover { text-decoration: underline; }
.auth-modal .form-error.form-success { background: rgba(46,204,113,0.2); border-color: #2ecc71; color: #81c784; }
.auth-modal .btn-fingerprint { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
@media (max-width: 768px) {
    .auth-modal.modal-overlay { padding: 0; align-items: stretch; justify-content: stretch; inset: 0; min-height: 100dvh; min-height: -webkit-fill-available; }
    .auth-modal .modal-box { width: 100%; max-width: none; min-height: 100%; height: auto; max-height: none; border-radius: 0; border: none; padding: max(36px, calc(env(safe-area-inset-top) + 24px)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .auth-modal .modal-head { padding: 6px 10px; }
    .auth-modal .modal-head h2 { font-size: 0.95rem; }
    .auth-modal .auth-tabs a { padding: 8px; font-size: 0.85rem; }
    .auth-modal .auth-pane { padding: 8px; }
    .auth-modal .form-group { margin-bottom: 6px; }
    .auth-modal .form-group label { font-size: 0.78rem; margin-bottom: 1px; }
    .auth-modal .form-group input { padding: 6px 8px; font-size: 0.85rem; min-height: 34px; }
    .auth-modal .auth-password-wrap input { padding-right: 38px; }
    .auth-modal .form-error { padding: 6px; margin-bottom: 6px; font-size: 0.8rem; }
    .auth-modal .btn-block { padding: 8px; margin-top: 4px; font-size: 0.85rem; }
    .auth-modal .auth-link { margin-top: 8px; font-size: 0.8rem; }
    .auth-modal #auth-remember { transform: scale(0.7); transform-origin: left center; }
}
