/* ====================================
   Login Page - Diseño AMEQ con Card
   ==================================== */

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

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* Contenedor principal con fondo de marca de agua */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100%;
    background-color: #f5f5f5;
    background-image: url('/static/images/AMEQ-logo-gris (1).png');
    background-repeat: no-repeat;
    background-position: center left;
    background-size: 40% auto;
    position: relative;
}

/* ====================================
   CARD BLANCO CENTRADO
   ==================================== */
.login-right {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 50px 45px;
    position: relative;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Logo eliminado ya que está en el fondo */
.login-logo {
    display: none;
}

/* Contenedor del formulario */
.login-form-wrapper {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

/* Título y subtítulo */
.login-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.login-header p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 40px;
}

/* Formulario */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Input Groups */
.input-group {
    position: relative;
}

.input-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.input-group input {
    width: 100%;
    padding: 15px 18px;
    padding-right: 45px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    color: #1f2937;
    transition: all 0.3s ease;
    background: #ffffff;
    font-style: italic;
}

.input-group input:focus {
    outline: none;
    border-color: #0066cc;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.input-group input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Ícono dentro del input */
.input-icon {
    position: absolute;
    right: 16px;
    top: 48px;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s ease;
}

.input-icon:hover {
    color: #6b7280;
}

/* Link olvidar contraseña */
.forgot-password {
    text-align: right;
    margin-top: 14px;
}

.forgot-password a {
    color: #6b7280;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password a:hover {
    color: #0066cc;
}

/* Botón principal - AZUL AMEQ */
.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.3px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
}

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

/* Link "Crear una cuenta" */
.create-account-link {
    text-align: center;
    margin-top: 20px;
    font-size: 15px;
    color: #6b7280;
}

.create-account-link a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.create-account-link a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 40px;
    color: #9ca3af;
    font-size: 13px;
}

/* Alertas */
.alert-container {
    margin-bottom: 20px;
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.alert svg {
    flex-shrink: 0;
}

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

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

.alert-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Login steps */
.login-step {
    display: none;
}

/* Email display en paso 2 */
.email-display-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 24px;
}

.email-display-container svg {
    color: #6b7280;
    flex-shrink: 0;
}

.email-display-text {
    flex: 1;
}

.email-display-text p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.email-display-text strong {
    font-size: 15px;
    color: #1f2937;
    display: block;
}

.btn-change-email {
    background: none;
    border: none;
    color: #0066cc;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    transition: color 0.2s ease;
}

.btn-change-email:hover {
    color: #0052a3;
}

/* Method selection */
.method-selection-header {
    margin-bottom: 24px;
}

.method-selection-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.method-selection-header p {
    font-size: 15px;
    color: #6b7280;
}

/* Botones de método */
.method-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-method {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.btn-method svg:first-child {
    color: #6b7280;
    flex-shrink: 0;
}

.btn-method-content {
    flex: 1;
}

.btn-method-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.btn-method-desc {
    display: block;
    font-size: 14px;
    color: #6b7280;
}

.btn-method:hover {
    border-color: #0066cc;
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-method.active {
    border-color: #0066cc;
    background: #f0f7ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.btn-method-arrow {
    color: #9ca3af;
    transition: transform 0.3s ease;
}

.btn-method:hover .btn-method-arrow,
.btn-method.active .btn-method-arrow {
    transform: translateX(4px);
    color: #0066cc;
}

/* Contenedores de métodos */
.method-container {
    display: none;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #f3f4f6;
    animation: fadeIn 0.3s ease;
}

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

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-spinner p {
    margin-top: 16px;
    color: #6b7280;
    font-size: 14px;
}

/* ====================================
   RESPONSIVE
   ==================================== */

/* TABLETS (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .login-container {
        background-size: 50% auto;
        background-position: center left 5%;
    }
    
    .login-right {
        padding: 40px 40px;
        max-width: 480px;
    }
    
    .login-header h1 {
        font-size: 32px;
    }
    
    .login-header p {
        font-size: 15px;
        margin-bottom: 32px;
    }
}

/* MÓVILES Y TABLETS PEQUEÑAS (menos de 768px) */
@media (max-width: 767px) {
    body {
        overflow-y: auto;
    }
    
    .login-container {
        height: auto;
        min-height: 100vh;
        background-size: 80% auto;
        background-position: center top 10%;
        padding: 20px;
    }
    
    .login-right {
        padding: 35px 30px;
        margin: 0;
        min-height: auto;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }
    
    .login-form-wrapper {
        max-width: 100%;
    }
    
    .login-header h1 {
        font-size: 28px;
    }
    
    .login-header p {
        font-size: 15px;
        margin-bottom: 28px;
    }
    
    .input-group input {
        padding: 14px 16px;
        padding-right: 42px;
        font-size: 16px; /* iOS fix - prevenir zoom */
    }
    
    .input-icon {
        top: 46px;
    }
    
    .btn-login {
        padding: 15px;
        font-size: 15px;
    }
    
    .btn-method {
        padding: 16px 18px;
    }
    
    .btn-method svg {
        width: 22px;
        height: 22px;
    }
    
    .btn-method-title {
        font-size: 15px;
    }
    
    .btn-method-desc {
        font-size: 13px;
    }
    
    .login-footer {
        margin-top: 32px;
        font-size: 12px;
    }
}

/* MÓVILES PEQUEÑOS (menos de 480px) */
@media (max-width: 479px) {
    .login-container {
        background-size: 100% auto;
        background-position: center top 5%;
        padding: 15px;
    }
    
    .login-right {
        padding: 30px 25px;
        border-radius: 12px;
    }
    
    .login-header h1 {
        font-size: 26px;
    }
    
    .login-header p {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .input-group label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .input-group input {
        padding: 13px 15px;
        padding-right: 40px;
        font-size: 16px;
    }
    
    .input-icon {
        right: 14px;
        top: 44px;
    }
    
    .btn-login {
        padding: 14px;
        font-size: 15px;
    }
    
    .btn-method {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .btn-method svg {
        width: 20px;
        height: 20px;
    }
    
    .btn-method-title {
        font-size: 14px;
        margin-bottom: 2px;
    }
    
    .btn-method-desc {
        font-size: 12px;
    }
    
    .email-display-container {
        padding: 12px 16px;
        gap: 10px;
    }
    
    .email-display-text p {
        font-size: 12px;
    }
    
    .email-display-text strong {
        font-size: 14px;
    }
    
    .alert {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .login-footer {
        margin-top: 24px;
    }
    
    .create-account-link {
        font-size: 14px;
        margin-top: 16px;
    }
}

/* OPTIMIZACIONES ADICIONALES */

/* Suavizar animaciones en dispositivos de baja potencia */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Fix para pantallas táctiles */
@media (hover: none) and (pointer: coarse) {
    .btn-login:hover,
    .btn-method:hover {
        transform: none;
    }
    
    .input-icon:hover {
        color: #9ca3af;
    }
}

/* Fix para iOS - Prevenir zoom en inputs */
@supports (-webkit-touch-callout: none) {
    .input-group input {
        font-size: 16px !important;
    }
}

/* Scroll suave */
.login-right {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* ====================================
   FIN DE LOGIN.CSS
   ==================================== */