/* Auth forms (register / login) — Minimal Glass */

/* ═══════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════ */

.auth-form {
    max-width: 420px;
    margin: 0 auto;
}

.auth-title {
    text-align: center;
}

.form-field-group {
    position: relative;
    margin-bottom: 1rem;
}

.form-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    pointer-events: none;
}

.form-field {
    background-color: var(--surface-2);
    border: 1px solid var(--search-border);
    color: var(--text);
    box-shadow: none;
    padding-left: 40px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}

.form-field::placeholder {
    color: var(--text-faint);
    opacity: 1;
}

.form-field:focus {
    background-color: var(--surface-2);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.consent-wrap {
    color: var(--text);
}

.consent-wrap .form-check-input {
    background-color: var(--surface-2);
    border-color: var(--search-border);
    box-shadow: none;
}

.consent-wrap .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.consent-wrap .form-check-input:focus {
    border-color: var(--search-border-focus);
    box-shadow: 0 0 0 1px var(--search-border-focus);
}

/* ═══════════════════════════════════════════════════════════
   GLASS CARD
   ═══════════════════════════════════════════════════════════ */

.auth-card {
    max-width: 440px;
    margin: 3rem auto;
    padding: 2.25rem 2rem;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-card-header > i.fa-solid {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    display: block;
}

.auth-card-header .auth-title {
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Entrance animation ────────────────────────────────────── */
.auth-entrance {
    animation: authFadeUp 0.45s ease-out both;
}

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-entrance {
        animation: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   FLOATING LABELS
   ═══════════════════════════════════════════════════════════ */

.auth-floating-group {
    position: relative;
    margin-bottom: 1rem;
}

.auth-floating-input {
    padding-left: 40px;
    padding-top: 1.4rem;
    padding-bottom: 0.4rem;
    height: auto;
}

.auth-floating-label {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 0.95rem;
    pointer-events: none;
    transition: top 0.18s ease, font-size 0.18s ease, color 0.18s ease;
}

.auth-floating-label i {
    margin-right: 4px;
}

.auth-floating-input:focus + .auth-floating-label,
.auth-floating-input:not(:placeholder-shown) + .auth-floating-label {
    top: 8px;
    transform: none;
    font-size: 0.72rem;
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   ALERTS → lásd: components.css (.app-alert)
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   OTP 6-DIGIT INPUT
   ═══════════════════════════════════════════════════════════ */

.auth-otp-label {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.auth-otp-label i {
    margin-right: 4px;
}

.auth-otp-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.auth-otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text);
    background-color: var(--surface-2);
    border: 1.5px solid var(--search-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
    caret-color: var(--accent);
}

.auth-otp-digit:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    transform: scale(1.05);
}

.auth-otp-digit.filled {
    border-color: var(--accent);
}

@keyframes otpShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.auth-otp-group.shake {
    animation: otpShake 0.4s ease-in-out;
}

@media (max-width: 400px) {
    .auth-otp-digit {
        width: 40px;
        height: 48px;
        font-size: 1.25rem;
    }
    .auth-otp-group {
        gap: 0.35rem;
    }
}

.auth-otp-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    transition: color 0.3s ease;
}

.auth-otp-countdown.expired {
    color: var(--danger);
}

.auth-otp-countdown.urgent {
    color: var(--warning);
}

.auth-otp-countdown i {
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════
   PASSWORD TOGGLE
   ═══════════════════════════════════════════════════════════ */

.auth-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    z-index: 2;
    transition: color 0.15s;
}

.auth-pw-toggle:hover {
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   PASSWORD STRENGTH METER
   ═══════════════════════════════════════════════════════════ */

.auth-strength {
    height: 4px;
    background: var(--surface-3);
    border-radius: 2px;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.auth-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.auth-strength-bar.s1 { background-color: var(--danger); }
.auth-strength-bar.s2 { background-color: var(--warning); }
.auth-strength-bar.s3 { background-color: var(--success); }
.auth-strength-bar.s4 { background-color: var(--success); }

/* ═══════════════════════════════════════════════════════════
   CUSTOM CHECKBOX
   ═══════════════════════════════════════════════════════════ */

.auth-custom-check {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.auth-custom-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.auth-custom-check label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    font-size: 0.88rem;
    cursor: pointer;
    min-width: 0;
    flex: 1 1 auto;
}

.auth-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--search-border);
    border-radius: 5px;
    background-color: var(--surface-2);
    transition: all 0.18s ease;
    font-size: 0.7rem;
    color: transparent;
}

.auth-custom-check input:checked + label .auth-check-icon {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--white);
    transform: scale(1.05);
}

.auth-custom-check label:hover .auth-check-icon {
    border-color: var(--accent);
}

/* ── Info tooltip for consent ─────────────────────────────── */
.auth-info-trigger {
    position: static;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: help;
    vertical-align: middle;
    transition: color 0.15s;
}

.auth-info-trigger:hover,
.auth-info-trigger:focus {
    color: var(--accent);
}

.auth-tooltip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: 100%;
    padding: 0.65rem 0.75rem;
    background-color: var(--surface-1);
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.45;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    z-index: 10;
}

.auth-tooltip a {
    color: var(--accent);
    text-decoration: underline;
}

.auth-info-trigger:hover .auth-tooltip,
.auth-info-trigger:focus .auth-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Arrow points DOWN (tooltip is above the trigger) */
.auth-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 0.5rem;
    border: 6px solid transparent;
    border-top-color: var(--surface-1);
}

/* ═══════════════════════════════════════════════════════════
   SUBMIT BUTTON
   ═══════════════════════════════════════════════════════════ */

.auth-submit-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    font-weight: 600;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   AUTH FOOTER
   ═══════════════════════════════════════════════════════════ */

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}

.auth-footer a:hover {
    color: var(--accent-2);
    text-decoration: underline;
}
