/* ==========================================================================
   inoX-Network — pages/auth.css
   Login, Registrierung, Passwort-Reset Seiten
   Ref: FRONTEND_SPEC.md Kapitel 14
   ========================================================================== */

/* --- Auth-Seite (zentriert) --- */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px - 200px);
    padding: var(--space-8) var(--space-4);
}

/* --- Auth-Card --- */

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
}

.auth-card-wide {
    max-width: 520px;
}

.auth-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-2);
    text-align: center;
}

.auth-subtitle {
    font-size: var(--font-size-sm);
    text-align: center;
    margin-bottom: var(--space-6);
}

/* --- Auth-Formular --- */

.auth-form {
    margin-bottom: var(--space-6);
}

/* --- Fehlermeldung / Erfolgsmeldung (Block) --- */

.auth-error,
.auth-success {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-5);
}

.auth-error {
    background: rgba(192, 102, 92, 0.1);
    color: var(--color-error);
    border-left: 4px solid var(--color-error);
}

.auth-success {
    background: rgba(122, 173, 125, 0.1);
    color: var(--color-success);
    border-left: 4px solid var(--color-success);
}

.auth-error svg,
.auth-success svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* --- Passwort-Feld (mit Toggle) --- */

.password-field {
    position: relative;
}

.password-field .form-input {
    padding-right: var(--space-12);
}

.password-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--color-text);
}

.password-toggle.active {
    color: var(--color-primary);
}

/* --- Passwort-Stärke-Indikator --- */

.password-strength {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.password-strength-bar {
    flex: 1;
    height: 4px;
    background: var(--color-bg-muted);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    transition: width var(--transition-base), background var(--transition-base);
}

.password-strength-fill[data-strength="weak"] {
    width: 25%;
    background: var(--color-error);
}

.password-strength-fill[data-strength="fair"] {
    width: 50%;
    background: var(--color-warning);
}

.password-strength-fill[data-strength="good"] {
    width: 75%;
    background: var(--color-info);
}

.password-strength-fill[data-strength="strong"] {
    width: 100%;
    background: var(--color-success);
}

.password-strength-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* --- Kundentyp-Toggle (B2C/B2B) --- */

.customer-type-fieldset {
    border: none;
    padding: 0;
}

.customer-type-toggle {
    display: flex;
    gap: var(--space-2);
    background: var(--color-bg-muted);
    border-radius: var(--radius-md);
    padding: var(--space-1);
}

.customer-type-option {
    flex: 1;
    cursor: pointer;
}

.customer-type-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.customer-type-label {
    display: block;
    padding: var(--space-3) var(--space-4);
    text-align: center;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.customer-type-option input:checked + .customer-type-label {
    background: var(--color-bg);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* B2B-Felder Animation */
.b2b-fields {
    overflow: hidden;
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-5);
    margin-top: var(--space-2);
}

/* --- Formular-Zeile (2 Spalten) --- */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

/* --- Auth-Links --- */

.auth-links {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.auth-link {
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.auth-link:hover {
    color: var(--color-primary);
}

.auth-link strong {
    color: var(--color-primary);
}

.auth-divider {
    margin: 0 var(--space-3);
    color: var(--color-border);
}

/* --- Mobile --- */

@media (max-width: 576px) {
    .auth-page {
        padding: var(--space-4);
        align-items: flex-start;
        padding-top: var(--space-8);
    }

    .auth-card {
        padding: var(--space-6);
        border-radius: var(--radius-lg);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-title {
        font-size: var(--font-size-2xl);
    }
}
