/* ============================================
   OTIC Login - CSS (Colores CAFED)
   ============================================ */

:root {
    /* Colores personalizados */
    --main-red:     #ee3627;
    --main-gray:    #e7e7ee;
    --main-blue:    #1454a1;
    
    /* Neutrales */
    --surface-0:    #0a0a1a;
    --surface-50:   #0f0f23;
    --surface-100:  #16162e;
    --surface-200:  #1e1e3a;
    --surface-300:  #2a2a4a;
    
    --text-primary:   #ffffff;
    --text-secondary: #b0b0c0;
    --text-muted:     #80808a;
    
    --error:    #ef4444;
    --success:  #10b981;
    
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --radius-md: 12px;
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--surface-0);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   LOGIN CONTAINER
   ============================================ */

.login-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Efecto de fondo degradado */
.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 40%, rgba(20, 84, 161, 0.15), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   LOGIN PANELS
   ============================================ */

.login-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* BRANDING PANEL */
.login-branding {
    background: linear-gradient(135deg, var(--main-blue) 0%, #0d3470 100%);
    display: none;
}

@media (min-width: 1024px) {
    .login-branding {
        display: flex;
    }
}

.branding-content {
    text-align: center;
    color: white;
    max-width: 400px;
}

.logo-section {
    margin-bottom: 60px;
}

.logo-img {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.logo-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.logo-section p {
    font-size: 0.95rem;
    opacity: 0.9;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.branding-text h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.branding-text p {
    font-size: 0.95rem;
    opacity: 0.85;
    line-height: 1.6;
}

/* FORM PANEL */
.login-form-panel {
    background: var(--surface-100);
    border-left: 1px solid rgba(0, 61, 130, 0.1);
}

@media (max-width: 1023px) {
    .login-form-panel {
        width: 100%;
        background: var(--surface-0);
        border-left: none;
    }
}

/* ============================================
   LOGIN FORM
   ============================================ */

.login-form {
    width: 100%;
    max-width: 380px;
}

.form-header {
    margin-bottom: 40px;
    text-align: center;
}

.form-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.form-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-200);
    border: 1.5px solid rgba(0, 61, 130, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:hover {
    border-color: rgba(20, 84, 161, 0.3);
}

.form-input:focus {
    border-color: var(--main-blue);
    background: var(--surface-300);
    box-shadow: 0 0 0 3px rgba(20, 84, 161, 0.1);
}

.form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password wrapper */
.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
}

.toggle-password:hover {
    color: var(--main-blue);
}

/* Input error */
.input-error {
    display: block;
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 4px;
}

/* Captcha wrapper */
.captcha-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.captcha-wrapper .form-input {
    flex: 1;
}

.btn-refresh-captcha {
    background: var(--surface-200);
    border: 1.5px solid rgba(0, 61, 130, 0.2);
    color: var(--text-secondary);
    min-width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition);
}

.btn-refresh-captcha:hover {
    border-color: var(--main-blue);
    background: var(--surface-300);
    color: var(--main-blue);
    transform: rotate(30deg);
}

/* Checkbox */
.checkbox-group {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--main-blue);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--error);
    color: #f87171;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success);
    color: #34d399;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-login {
    background: linear-gradient(135deg, var(--main-blue) 0%, #0d3470 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(20, 84, 161, 0.3);
    margin-bottom: 20px;
}

.btn-login:hover {
    box-shadow: 0 6px 20px rgba(20, 84, 161, 0.45);
    transform: translateY(-2px);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(20, 84, 161, 0.3);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--main-blue) 0%, #0d3470 100%);
    border-radius: var(--radius-md);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   FORM FOOTER
   ============================================ */

.form-footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.link-help {
    color: var(--main-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}

.link-help:hover {
    color: var(--main-red);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    min-width: 300px;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.toast-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .login-container {
        flex-direction: column;
    }

    .login-form {
        max-width: 100%;
    }

    .form-header h3 {
        font-size: 1.5rem;
    }

    .toast-container {
        left: 20px;
        right: 20px;
    }

    .toast {
        min-width: unset;
    }
}
