/* ========================================
   LOGIN Y REGISTER - Famtasker
   Versión: 2.0
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Contenedor principal */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Tarjeta */
.auth-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    animation: fadeInUp 0.5s ease-out;
}

.auth-card.register-card {
    max-width: 480px;
}

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

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

.icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 20px;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: #64748b;
}

/* Alertas */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #065f46;
    border: 1px solid #bbf7d0;
}

/* Formulario */
.auth-form {
    margin-bottom: 1.5rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
}

.input-icon-wrapper .form-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: #1e293b;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
    outline: none;
}

.input-icon-wrapper .form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-icon-wrapper .form-input:focus ~ .icon {
    color: #3b82f6;
}

/* Botones */
.btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #334155, #1e293b);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 41, 59, 0.4);
}

.btn-secondary {
    background: white;
    color: #1e293b;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

/* Divisor */
.divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
    background: white;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Sección registro */
.register-section {
    text-align: center;
}

.register-text {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

/* Enlace volver */
.back-to-login {
    margin-top: 1.5rem;
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 40px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.back-link:hover {
    background: #3b82f6;
    color: white;
    transform: translateX(-3px);
}

/* Password field */
.password-field {
    position: relative;
}

.password-buttons {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.password-buttons button {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 5px;
    border-radius: 6px;
    font-size: 1rem;
}

.password-buttons button:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all .3s ease;
}

.strength-weak { background: #ef4444; width: 25%; }
.strength-medium { background: #f59e0b; width: 50%; }
.strength-good { background: #3b82f6; width: 75%; }
.strength-strong { background: #10b981; width: 100%; }

.strength-text {
    font-size: .7rem;
    margin-top: 5px;
    text-align: right;
    font-weight: 500;
}

.text-weak { color: #ef4444; }
.text-medium { color: #f59e0b; }
.text-good { color: #3b82f6; }
.text-strong { color: #10b981; }

.password-match {
    font-size: .7rem;
    margin-top: 5px;
    text-align: right;
}

.match-valid { color: #10b981; }
.match-invalid { color: #ef4444; }

/* Register button */
.register-btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 41, 59, 0.4);
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }
    .auth-title {
        font-size: 1.5rem;
    }
    .icon-container {
        width: 55px;
        height: 55px;
    }
}

@media (min-width: 768px) {
    .auth-card {
        padding: 2.5rem;
    }
    .auth-card:hover {
        transform: translateY(-4px);
        transition: all 0.3s ease;
    }
}
