body {
    margin: 0;
    padding: 0;
    background: #F5F7FA;
    font-family: 'Montserrat', sans-serif;
    color: #222;
}

.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

.left {
    flex: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-image: url("/images/branding/teamwork.jpg");
    position: relative;
}

.logo-overlay {
    position: absolute;
    top: 25px;
    left: 25px;
    width: 250px;
    height: auto;
    object-fit: contain;
}

.logo-shadow {
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.30));
}

.logo {
    width: 200px;
    margin-bottom: 15px;
}

.right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.content {
    width: 100%;
    max-width: 300px;
    background: #fff;
    padding: 40px 35px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 10px 0;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    text-align: center;
    font-size: 15px;
    color: #555;
    margin-bottom: 25px;
    line-height: 1.4;
}

a.admin-link {
    display: block;
    margin-top: 20px;
    font-size: 15px;
    color: #1A73E8;
    text-decoration: none;
    text-align: center;
}

.inner {
    width: 80%;
    max-width: 320px;
    margin: 0 auto;
}

.inner .btn {
    width: 100%;
    display: block;
    margin-right: 0;
    box-sizing: border-box;
}

.btn {
    text-align: center;
    display: inline-block;
    padding: 14px 32px;
    margin-right: 10px;
    margin-bottom: 15px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: 0.2s ease-in-out;
    border: 2px solid transparent;
}

.btn-primary {
    background: #1A73E8;
    color: #fff;
    border-color: #1A73E8;
}

.btn-primary:hover {
    background: #155BC0;
}

.btn-outline {
    background: transparent;
    color: #1A73E8;
    border-color: #1A73E8;
}

.btn-outline:hover {
    background: #E6F0FF;
}

.input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid #ccc;
    display: block;
    box-sizing: border-box;
}

.error {
    color: #dc2626;
    font-size: 13px;
    display: block;
    margin-top: 5px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 14px;
    color: #1A73E8;
    text-decoration: none;
}

.back-link svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* ============================
   RESPONSIVE GENERAL
============================ */
@media (max-width: 900px) {
    .wrapper {
        flex-direction: column;
        min-height: auto;
    }

    .left {
        width: 100%;
        height: auto;
        min-height: 260px;
        background-size: cover;
        background-position: center;
    }

    .logo-overlay {
        width: 180px;
        top: 15px;
        left: 15px;
    }

    .right { padding: 20px; }
    .content { max-width: 100%; }
    
    .btn {
        width: 80%;
        text-align: center;
        margin-right: 0;
    }
}

/* ============================
   FIX CRÍTICO PARA SAFARI iOS
============================ */
@supports (-webkit-touch-callout: none) {
    .left {
        height: auto !important;
        min-height: 260px !important;
    }
}

/* ============================
   MODO OSCURO
============================ */
@media (prefers-color-scheme: dark) {
    body {
        background: #111;
        color: #eee;
    }
    
    .content {
        background: #1f1f1f !important;
        border: 1px solid #333 !important;
        color: #f3f3f3 !important;
        box-shadow: none !important;
    }
    
    h1 {
        color: #fff !important;
    }
    
    .subtitle {
        color: #ccc !important;
    }

    /* Inputs normales en dark mode */
    .input {
        background: #2b2b2b !important;
        border: 1px solid #444 !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
    }
    
    .input::placeholder {
        color: #bbb !important;
        -webkit-text-fill-color: #bbb !important;
    }
    
    /* FIX CRÍTICO: Autofill en Dark Mode */
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus,
    input:-webkit-autofill:active {
        -webkit-box-shadow: 0 0 0 30px #2b2b2b inset !important;
        -webkit-text-fill-color: #ffffff !important;
        caret-color: #ffffff !important;
        transition: background-color 5000s ease-in-out 0s;
    }
    
    /* Para Firefox */
    input:-moz-autofill {
        background-color: #2b2b2b !important;
        color: #ffffff !important;
    }
    
    /* Inputs de Filament en dark mode */
    .fi-input {
        background: #2b2b2b !important;
        border: 1px solid #444 !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
    }
    
    .fi-input::placeholder,
    .content .fi-input::placeholder {
        color: #bbb !important;
        -webkit-text-fill-color: #bbb !important;
    }
    
    .btn-primary {
        background: #1A73E8 !important;
    }
    
    .forgot {
        color: #4da3ff;
        text-decoration: none !important;
        text-align: center;
    }
    
    .admin-link {
        color: #7bb8ff !important;
    }
    
    .back-link {
        color: #7bb8ff !important;
    }
}

/* ============================
   NOTIFICACIONES
============================ */
.notification-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.notification-text {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

/* Success - Verde */
.notification-success .notification-icon {
    color: #28a745;
}
.notification-success .notification-text {
    color: #28a745;
}

/* Error - Rojo */
.notification-error .notification-icon {
    color: #dc3545;
}
.notification-error .notification-text {
    color: #dc3545;
}

/* Warning - Naranja */
.notification-warning .notification-icon {
    color: #ffc107;
}
.notification-warning .notification-text {
    color: #ff8800;
}

/* Info - Azul */
.notification-info .notification-icon {
    color: #1A73E8;
}
.notification-info .notification-text {
    color: #1A73E8;
}

/* Notificaciones en dark mode */
@media (prefers-color-scheme: dark) {
    .notification-box {
        background: #2a2a2a;
        border-color: #444;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .notification-success .notification-icon,
    .notification-success .notification-text {
        color: #4ade80;
    }

    .notification-error .notification-icon,
    .notification-error .notification-text {
        color: #ff6b6b;
    }

    .notification-warning .notification-icon,
    .notification-warning .notification-text {
        color: #ffb84d;
    }

    .notification-info .notification-icon,
    .notification-info .notification-text {
        color: #60a5fa;
    }
}

/* ============================
   ERROR ILLUSTRATIONS
============================ */
.error-illustration {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.button-group .btn {
    flex: 1;
    min-width: 150px;
    text-align: center;
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
    }
}
