/* ===== Reset y variables ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #0891B2;
    --primary-hover: #0e7490;
    --error: #EF4444;
    --success: #10B981;
    --bg: #F1F5F9;
    --card-bg: #FFFFFF;
    --text: #1E293B;
    --text-muted: #64748B;
    --border: #CBD5E1;
    --radius: 8px;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font-stack);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ===== Card ===== */
.auth-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    text-align: center;
}

.auth-card .subtitle {
    color: var(--text-muted);
    text-align: center;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* ===== Formularios ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.form-group input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    background: white;
    -webkit-appearance: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-group input.input-error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group .error-msg {
    color: var(--error);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.form-group input.input-error ~ .error-msg {
    display: block;
}

/* ===== Password toggle ===== */
.input-wrapper {
    position: relative;
}

.input-wrapper input {
    padding-right: 2.75rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.8rem;
}

/* ===== Botones ===== */
.btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    margin-top: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

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

/* ===== Alertas ===== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.alert-error {
    background: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
}

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

.alert.visible {
    display: block;
}

/* ===== Links ===== */
.auth-links {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
}

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

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

/* ===== Password strength ===== */
.password-strength {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.strength-bar {
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    margin-bottom: 0.25rem;
    overflow: hidden;
}

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

.strength-weak .strength-bar-fill { width: 33%; background: var(--error); }
.strength-medium .strength-bar-fill { width: 66%; background: #F59E0B; }
.strength-strong .strength-bar-fill { width: 100%; background: var(--success); }

.strength-text {
    color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (min-width: 640px) {
    .auth-card {
        padding: 2.5rem;
    }
}

@media (max-width: 380px) {
    .auth-card {
        padding: 1.5rem;
    }

    .auth-card h1 {
        font-size: 1.25rem;
    }
}
