/* public/css/auth.css
 * Vollständige Styles für alle Authentifizierungsseiten
 * Verwendung: login.html, register.html, verify-email.html, reset-password.html
 */

/* ============================================================
   RESET & BOX-SIZING
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================
   GLOBALE VARIABLEN (Design Tokens)
   ============================================================ */
:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --primary-light: #4895ef;
    --primary-bg: #eef1fd;
    --success: #2d9d78;
    --success-bg: #e6f4f0;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #e03e3e;
    --danger-bg: #fdecea;
    --info: #7209b7;
    --info-bg: #f3e8ff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #565656;
    --gray-600: #4e555e;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
    --font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ============================================================
   BASIS – BODY & CONTAINER
   ============================================================ */
body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #e0e7ff 0%, #f0fdf4 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ============================================================
   ALLGEMEINE CARD (für verify, reset, login, register)
   ============================================================ */
.card,
.login-card,
.register-card,
.reset-card,
.verify-card {
    background: #fff;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 48px 40px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

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

/* ============================================================
   LOGO
   ============================================================ */
.logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 32px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo svg,
.logo i {
    width: 36px;
    height: 36px;
}

/* ============================================================
   TYPOGRAPHIE
   ============================================================ */
h1 {
    font-size: 1.4rem;
    color: var(--gray-800);
    margin-bottom: 10px;
    font-weight: 700;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

p {
    color: var(--gray-600);
    line-height: 1.5;
}

.subtitle,
.welcome-message {
    color: var(--gray-600);
    font-size: 0.925rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.small {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 16px;
}

/* ============================================================
   ICON (für verify, success, error)
   ============================================================ */
.icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    line-height: 1;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.2s,
        transform 0.1s;
    text-decoration: none;
    text-align: center;
    margin-bottom: 12px;
}

.btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
}

.btn-outline:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #238b62;
}

/* ============================================================
   STATUS BOXEN (für verify, reset)
   ============================================================ */
.status-box {
    padding: 14px;
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-align: center;
}

.status-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.status-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.status-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid #bfdbfe;
}

/* ============================================================
   SPINNER (Ladeanimation)
   ============================================================ */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   FORMULARE & INPUTS (allgemein)
   ============================================================ */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.9rem;
}

label.required::after {
    content: " *";
    color: var(--danger);
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
    font-family: var(--font-family);
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

input[readonly] {
    background-color: var(--gray-100);
    color: var(--gray-700);
    cursor: not-allowed;
}

input.error {
    border-color: var(--danger);
    background-color: rgba(247, 37, 133, 0.05);
}

/* ============================================================
   EMAIL-INPUT-GRUPPE (für verify)
   ============================================================ */
.email-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.email-input-group input {
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
}

.email-input-group input:focus {
    border-color: var(--primary);
}

/* ============================================================
   FEHLER- & ERFOLGSMELDUNGEN
   ============================================================ */
.error-message {
    color: var(--danger);
    margin-top: 0.5rem;
    font-size: 0.85rem;
    display: none;
    animation: slideDown 0.2s ease-out;
}

.success-message {
    background: var(--success-bg);
    color: var(--success);
    padding: 12px;
    border-radius: var(--border-radius-md);
    margin-top: 1rem;
    text-align: center;
    display: none;
    font-size: 0.9rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   LINKS & FOOTER
   ============================================================ */
.links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.links a:hover {
    text-decoration: underline;
}

/* ============================================================
   MODAL (für AGB / Datenschutz in register.html)
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
}

.modal-footer {
    margin-top: 1.5rem;
    text-align: right;
}

/* ============================================================
   CHECKBOX & TERMS (register)
   ============================================================ */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 1.5rem 0 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--gray-200);
    text-align: left;
    cursor: default;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.checkbox-container label {
    flex: 1;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
}

.checkbox-container a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.checkbox-container a:hover {
    text-decoration: underline;
}

.terms-notice {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--gray-500);
    text-align: center;
    padding: 0.5rem;
    background: rgba(108, 117, 125, 0.05);
    border-radius: var(--border-radius-md);
}

/* ============================================================
   PASSWORT-STÄRKE (register)
   ============================================================ */
.strength-meter {
    margin-top: 0.5rem;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.strength-meter-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s;
}

.strength-meter-bar.weak {
    background: var(--danger);
    width: 33.33%;
}

.strength-meter-bar.medium {
    background: #ffaa00;
    width: 66.66%;
}

.strength-meter-bar.strong {
    background: #00c853;
    width: 100%;
}

.password-hint {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.password-hint span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.password-hint i.fa-check {
    color: #00c853;
}

.password-hint i.fa-times {
    color: var(--danger);
}

/* ============================================================
   STEP-INDIKATOR (reset-password)
   ============================================================ */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin: 0 0 32px;
    position: relative;
    padding: 0 20px;
}

.step {
    text-align: center;
    flex: 1;
    position: relative;
    font-weight: 600;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.step .step-label {
    font-size: 0.7rem;
    font-weight: normal;
    margin-top: 4px;
}

.step.completed {
    color: var(--success);
}

.step.active {
    color: var(--primary);
    font-weight: 700;
}

/* ============================================================
   INFO-BOX (reset-password, etc.)
   ============================================================ */
.info-box {
    background: var(--info-bg);
    border-left: 4px solid var(--info);
    padding: 12px;
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: var(--gray-700);
    text-align: left;
}

.token-info {
    background: var(--gray-100);
    padding: 8px 12px;
    border-radius: var(--border-radius-md);
    margin-bottom: 1rem;
    font-size: 0.8rem;
    text-align: center;
}

/* ============================================================
   PASSWORD STRENGTH BAR (reset-password)
   ============================================================ */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.2s;
}

.password-strength-bar.strength-weak {
    background: var(--danger);
    width: 33%;
}

.password-strength-bar.strength-medium {
    background: #ffaa00;
    width: 66%;
}

.password-strength-bar.strength-strong {
    background: #00c853;
    width: 100%;
}

/* ============================================================
   RESPONSIVE ANPASSUNGEN
   ============================================================ */
@media (max-width: 576px) {
    .card,
    .login-card,
    .register-card,
    .reset-card,
    .verify-card {
        padding: 32px 24px;
    }

    .logo {
        font-size: 1.8rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    .btn {
        padding: 12px;
    }

    .step-indicator {
        padding: 0;
    }

    .step {
        font-size: 0.75rem;
    }

    .password-hint {
        flex-direction: column;
        gap: 4px;
    }
}

/* ============================================================
   ZUSÄTZLICHE KLASSEN FÜR VERIFY (Kompatibilität mit alter Version)
   ============================================================ */
.verify-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.verify-card {
    max-width: 420px;
    width: 100%;
}

/* ============================================================
   RESET-PASSWORD SPEZIFISCHE ELEMENTE
   ============================================================ */
.reset-card {
    max-width: 460px;
}

#emailDisplay {
    background: var(--gray-100);
    padding: 8px;
    border-radius: var(--border-radius-md);
    margin-bottom: 16px;
    word-break: break-all;
}

#passwordMatch {
    margin-top: 4px;
    font-size: 0.75rem;
}

/* ============================================================
   LOGIN / REGISTER SPEZIFISCHE ANPASSUNGEN
   ============================================================ */
.login-container,
.register-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.login-card .btn,
.register-card .btn {
    margin-top: 0.5rem;
}

/* ============================================================
   ALLGEMEINE HILFSKLASSEN
   ============================================================ */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.hidden {
    display: none !important;
}
