:root {
    /* Colores institucionales IMSS */
    --imss-verde: #006341;
    --imss-verde-claro: #39A935;
    --imss-verde-luminoso: #00a86b;
    --imss-dorado: #B38E5D;
    --imss-guinda: #9f2241;
    --bg-light: #f0f4f8;
    --text-dark: #1a202c;
    --text-muted: #64748b;
}

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

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    background: var(--bg-light);
    position: relative;
    overflow-x: hidden;
}

/* ===== BACKGROUND DESIGN ===== */
.bg-design {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.bg-design::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 100%;
    background: linear-gradient(135deg, var(--imss-verde) 0%, #003825 100%);
    transform: skewX(-15deg);
    transform-origin: top left;
    left: -30%;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.bg-circle-1 {
    width: 500px;
    height: 500px;
    background: var(--imss-verde-claro);
    top: -150px;
    left: -100px;
    animation: pulse-slow 8s ease-in-out infinite;
}

.bg-circle-2 {
    width: 300px;
    height: 300px;
    background: var(--imss-dorado);
    bottom: -80px;
    left: 20%;
    animation: pulse-slow 10s ease-in-out infinite reverse;
}

.bg-circle-3 {
    width: 400px;
    height: 400px;
    background: var(--imss-verde-luminoso);
    top: 30%;
    right: 60%;
    animation: pulse-slow 12s ease-in-out infinite;
}

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

/* ===== MAIN CONTAINER ===== */
.main-container {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ===== LEFT SIDE - BRANDING ===== */
.branding-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    color: white;
}

.brand-content {
    max-width: 500px;
}

.institution-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 50px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.institution-badge img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    padding: 4px;
}

.institution-badge span {
    font-weight: 600;
    font-size: 0.95rem;
}

.brand-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.brand-title .highlight {
    background: linear-gradient(135deg, var(--imss-verde-claro), var(--imss-dorado));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-description {
    font-size: 1.15rem;
    opacity: 0.9;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.tag i {
    color: var(--imss-dorado);
}

/* ===== RIGHT SIDE - LOGIN ===== */
.login-side {
    flex: 0 0 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background: white;
    position: relative;
}

.login-card {
    width: 100%;
    max-width: 380px;
    animation: fadeInUp 0.6s ease-out;
}

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

.login-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--imss-verde) 0%, var(--imss-verde-claro) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 15px 40px rgba(0, 99, 65, 0.25);
}

.login-icon i {
    font-size: 2rem;
    color: white;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Form */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-container {
    position: relative;
}

.input-container i.field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1rem;
    transition: color 0.3s;
}

.form-input {
    width: 100%;
    padding: 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.form-input:focus {
    outline: none;
    border-color: var(--imss-verde);
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 99, 65, 0.1);
}

.form-input:focus + i.field-icon {
    color: var(--imss-verde);
}

.toggle-pass {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color 0.3s;
}

.toggle-pass:hover {
    color: var(--imss-verde);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--imss-verde) 0%, var(--imss-verde-claro) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 99, 65, 0.25);
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 99, 65, 0.35);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-login.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-login.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.forgot-link {
    text-align: center;
    margin-top: 1.5rem;
}

.forgot-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.forgot-link a:hover {
    color: var(--imss-verde);
}

/* Developer Credits */
.dev-credits {
    position: absolute;
    bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 11px 16px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.dev-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 1%;
    border: 2px solid var(--imss-verde);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dev-avatar:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 20px rgba(0, 99, 65, 0.25);
}

.dev-info strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.dev-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dev-socials {
    display: flex;
    gap: 6px;
}

.dev-socials a {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dev-socials a:hover {
    background: var(--imss-verde);
    color: white;
    transform: translateY(-2px);
}

/* Modal foto desarrollador */
.avatar-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(3px);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.avatar-modal-overlay.active {
    display: flex;
}

.avatar-modal {
    width: min(420px, 96vw);
    background: #fff;
    border-radius: 18px;
    padding: 1rem 1rem 1.1rem;
    position: relative;
    text-align: center;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.35);
}

.avatar-modal h4 {
    margin: 0.4rem 0 0.9rem;
    color: #0f172a;
    font-size: 1rem;
}

.avatar-modal-img {
    width: min(326px, 94vw);
    height: min(320px, 113vw);
    object-fit: cover;
    object-position: center 3%;
    border-radius: 16px;
    border: 4px solid #e2e8f0;
}

.avatar-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.avatar-modal-close:hover {
    background: #e2e8f0;
}

.recovery-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    z-index: 2600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.recovery-modal-overlay.active {
    display: flex;
}

.recovery-modal {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 16px;
    border: 1px solid #dbe5df;
    box-shadow: 0 18px 44px rgba(2, 6, 23, 0.32);
    padding: 22px 20px;
    position: relative;
}

.recovery-modal h4 {
    margin: 0;
    color: #0f172a;
    font-size: 1.1rem;
}

.recovery-subtitle {
    margin: 6px 0 14px;
    color: #475569;
    font-size: 0.9rem;
}

.recovery-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 9px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
}

.recovery-step {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recovery-step label {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
}

.recovery-step input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 0.94rem;
}

.recovery-step input:focus {
    border-color: var(--imss-verde);
    box-shadow: 0 0 0 3px rgba(0, 99, 65, 0.12);
    outline: none;
}

.recovery-btn {
    margin-top: 6px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--imss-verde), var(--imss-verde-claro));
    color: #fff;
    font-weight: 700;
    min-height: 42px;
    cursor: pointer;
}

.recovery-helper {
    margin: 0 0 8px;
    font-size: 0.88rem;
    color: #334155;
}

.recovery-status {
    margin-top: 12px;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.87rem;
    display: none;
}

.recovery-status.is-error {
    display: block;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.recovery-status.is-success {
    display: block;
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #166534;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }

    .branding-side {
        padding: 2rem;
        text-align: center;
    }

    .brand-content {
        margin: 0 auto;
    }

    .brand-title {
        font-size: 2.5rem;
    }

    .feature-tags {
        justify-content: center;
    }

    .login-side {
        flex: none;
        padding: 2rem;
    }

    .dev-credits {
        position: relative;
        bottom: auto;
        margin-top: 2rem;
    }
}

@media (max-width: 480px) {
    .branding-side {
        padding: 1.5rem;
    }

    .brand-title {
        font-size: 2rem;
    }

    .feature-tags {
        display: none;
    }

    .login-side {
        padding: 1.5rem;
    }

    .login-card {
        max-width: 100%;
    }
}

/* ===== BURBUJA DE VIDEO TUTORIAL ===== */
.tutorial-bubble {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: linear-gradient(135deg, var(--imss-verde) 0%, var(--imss-verde-claro) 100%);
    color: white;
    padding: 14px 22px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0, 99, 65, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-decoration: none;
}

.tutorial-bubble:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 99, 65, 0.5);
}

.tutorial-bubble i {
    font-size: 1.5rem;
    color: #7de5b8;
    animation: pulse-icon 2s ease-in-out infinite;
}

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

.bubble-pulse {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #7de5b8;
    border-radius: 50%;
    animation: ping 1.5s ease-in-out infinite;
}

@keyframes ping {
    0% { transform: scale(1); opacity: 1; }
    75%, 100% { transform: scale(2); opacity: 0; }
}

@media (max-width: 768px) {
    .tutorial-bubble {
        bottom: 20px;
        right: 20px;
        padding: 12px 18px;
    }

    .bubble-text {
        display: none;
    }
}
