/*
 * auth.css — Gemeinsame Styles für Login und Register
 * Deployment: resources/css/auth.css
 * Einbinden via Vite: @vite(['resources/css/auth.css'])
 * In app.blade.php @push('styles') oder direkt in vite.config.js input
 */

/* ── Outer Container ─────────────────────────────────────────────────────── */
.auth-container {
    max-width: 26rem;
    margin: 2.5rem auto 0;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon-box {
    width: 3rem;
    height: 3rem;
    background: rgba(124,58,237,0.15);
    border: 1px solid rgba(124,58,237,0.25);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f4f4f5;
    margin: 0;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: #71717a;
    margin: 0.375rem 0 0;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.auth-card {
    background: #09090b;
    border: 1px solid #1f1f23;
    border-radius: 1rem;
    padding: 1.75rem;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.auth-alert {
    border-radius: 0.625rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.auth-alert--error {
    background: rgba(127,29,29,0.2);
    border: 1px solid rgba(185,28,28,0.3);
    color: #fca5a5;
}
.auth-alert--lockout {
    background: rgba(120,53,15,0.25);
    border: 1px solid rgba(217,119,6,0.4);
    color: #fcd34d;
}
.auth-alert--success {
    background: rgba(6,78,59,0.2);
    border: 1px solid rgba(52,211,153,0.25);
    color: #34d399;
    align-items: center;
}
.auth-alert svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
    width: 0.875rem;
    height: 0.875rem;
}
.auth-alert--success svg { margin-top: 0; }

/* ── Form ────────────────────────────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Field Group ─────────────────────────────────────────────────────────── */
.auth-field { position: relative; }

.auth-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #a1a1aa;
    margin-bottom: 0.375rem;
}

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.auth-input {
    width: 100%;
    background: #09090b;
    border: 1px solid #3f3f46;
    border-radius: 0.625rem;
    padding: 0.6rem 0.875rem;
    font-size: 0.875rem;
    color: #f4f4f5;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.auth-input--icon-right {
    padding-right: 2.5rem;
}
.auth-input:focus {
    border-color: rgba(124,58,237,0.6);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.auth-input--error {
    border-color: rgba(185,28,28,0.6) !important;
}

/* ── Eye Toggle Button ───────────────────────────────────────────────────── */
.auth-eye-btn {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #52525b;
    padding: 0.25rem;
    transition: color 0.15s;
}
.auth-eye-btn:hover { color: #a1a1aa; }
.auth-eye-btn svg   { width: 1rem; height: 1rem; display: block; }

/* ── Inline error / hint text ────────────────────────────────────────────── */
.auth-error-text {
    font-size: 0.72rem;
    color: #fca5a5;
    margin: 0.3rem 0 0;
}
.auth-hint {
    font-size: 0.68rem;
    margin: 0.3rem 0 0;
    display: none;
    align-items: center;
    gap: 0.3rem;
}
.auth-error-inline {
    font-size: 0.72rem;
    color: #f87171;
    margin: 0.3rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.auth-error-inline svg {
    width: 0.7rem;
    height: 0.7rem;
    flex-shrink: 0;
}

/* ── Submit Button ───────────────────────────────────────────────────────── */
.auth-btn {
    width: 100%;
    padding: 0.7rem;
    border-radius: 0.625rem;
    background: #7c3aed;
    border: none;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background 0.15s, opacity 0.15s, transform 0.1s;
    margin-top: 0;
}
.auth-btn:not(:disabled):hover {
    background: #6d28d9;
    transform: translateY(-1px);
    cursor: pointer;
}
.auth-btn:not(:disabled):active { transform: translateY(0); }
.auth-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── Step-Password (Login-spezifisch) ────────────────────────────────────── */
.auth-step-hidden {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.3s ease;
}

/* Email-Display Box (Login Step 2) */
.auth-email-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #09090b;
    border: 1px solid #3f3f46;
    border-radius: 0.625rem;
    padding: 0.5rem 0.75rem;
}
.auth-email-display-inner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}
.auth-email-display-inner svg {
    width: 0.75rem;
    height: 0.75rem;
    color: #52525b;
    flex-shrink: 0;
}
.auth-email-display span {
    font-size: 0.8rem;
    color: #a1a1aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auth-link-btn {
    font-size: 0.72rem;
    color: #7c3aed;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    margin-left: 0.75rem;
    white-space: nowrap;
    transition: color 0.15s;
}
.auth-link-btn:hover { color: #a78bfa; }

/* Remember-Checkbox */
.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.auth-remember input {
    width: 1rem;
    height: 1rem;
    accent-color: #7c3aed;
    cursor: pointer;
    flex-shrink: 0;
}
.auth-remember label {
    font-size: 0.8rem;
    color: #71717a;
    cursor: pointer;
    -webkit-user-select: none; user-select: none;
}

/* ── Register-spezifisch: Password Strength ──────────────────────────────── */
.auth-strength-bars {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.375rem;
    margin-top: 0.5rem;
}
.auth-strength-bar {
    flex: 1;
    height: 3px;
    border-radius: 9999px;
    background: #27272a;
    transition: background 0.3s;
}
.auth-strength-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.auth-strength-label {
    font-size: 0.7rem;
    color: #52525b;
    margin: 0;
    transition: color 0.3s;
}
.auth-strength-text {
    font-size: 0.7rem;
    font-weight: 500;
    margin: 0;
    color: #52525b;
}

/* Criteria List */
.auth-criteria {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.625rem;
}
.criterion {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.7rem;
    color: #52525b;
    transition: color 0.2s;
}
.criterion svg      { width: 0.7rem; height: 0.7rem; flex-shrink: 0; color: #3f3f46; transition: color 0.2s; }
.criterion.ok       { color: #34d399; }
.criterion.ok svg   { color: #34d399; }

/* Match-Message */
.auth-match-msg {
    font-size: 0.7rem;
    margin: 0.375rem 0 0;
    display: none;
    align-items: center;
    gap: 0.3rem;
}

/* Terms Box */
.auth-terms-box {
    background: rgba(39,39,42,0.5);
    border: 1px solid #27272a;
    border-radius: 0.625rem;
    padding: 0.75rem 0.875rem;
}
.auth-terms-box label {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
}
.auth-terms-box input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
    accent-color: #7c3aed;
    cursor: pointer;
}
.auth-terms-box span {
    font-size: 0.78rem;
    color: #a1a1aa;
    line-height: 1.55;
}
.auth-terms-box a {
    color: #a78bfa;
    text-decoration: none;
}
.auth-terms-box a:hover { text-decoration: underline; }
.auth-terms-error {
    font-size: 0.72rem;
    color: #f87171;
    margin: 0.375rem 0 0 1.625rem;
}

/* Name-Counter */
.auth-counter {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    color: #3f3f46;
    pointer-events: none;
}

/* ── Footer Text ─────────────────────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    font-size: 0.75rem;
    color: #52525b;
    margin-top: 1.25rem;
}
.auth-footer a {
    color: #a78bfa;
    text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

/* ── Spinner Animation ───────────────────────────────────────────────────── */
@keyframes auth-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Responsive: Mobil & Tablet ──────────────────────────────────────────── */
@media (max-width: 560px) {
    .auth-container { margin-top: 1.5rem; }
    .auth-card      { padding: 1.25rem; border-radius: 0.875rem; }
    .auth-header    { margin-bottom: 1.5rem; }
}
@media (max-width: 380px) {
    .auth-container { padding: 0 0.75rem; }
    .auth-card      { padding: 1rem; }
}

/* Reduced-Motion: Spinner als langsamere Rotation (Lade-Feedback bleibt erkennbar) */
@media (prefers-reduced-motion: reduce) {
    [style*="auth-spin"] { animation-duration: 1.5s !important; }
}
