:root {
    /* Colores institucionales IMSS */
    --imss-verde: #006341;
    --imss-verde-claro: #39A935;
    --imss-verde-profundo: #003825;
    --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-profundo) 0%, #002d1f 50%, var(--imss-verde) 100%);
    transform: skewX(-12deg);
    transform-origin: top left;
    left: -25%;
}

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

.bg-circle-1 {
    width: 550px;
    height: 550px;
    background: var(--imss-verde-claro);
    top: -180px;
    left: -120px;
    animation: pulse-slow 9s ease-in-out infinite;
}

.bg-circle-2 {
    width: 350px;
    height: 350px;
    background: var(--imss-dorado);
    bottom: -100px;
    left: 25%;
    animation: pulse-slow 11s ease-in-out infinite reverse;
}

.bg-circle-3 {
    width: 450px;
    height: 450px;
    background: var(--imss-verde-luminoso);
    top: 35%;
    right: 55%;
    animation: pulse-slow 13s ease-in-out infinite;
}

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

/* ===== 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: 520px;
}

.institution-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    padding: 14px 22px;
    border-radius: 50px;
    margin-bottom: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.institution-badge img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: white;
    padding: 5px;
}

.institution-badge span {
    font-weight: 700;
    font-size: 0.98rem;
    letter-spacing: 0.3px;
}

.brand-title {
    font-size: 3.8rem;
    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.2rem;
    opacity: 0.92;
    line-height: 1.75;
    margin-bottom: 2.5rem;
}

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

.tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.12);
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 0.88rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.tag i {
    color: var(--imss-dorado);
    font-size: 1rem;
}

/* ===== RIGHT SIDE - LOGIN ===== */
.login-side {
    flex: 0 0 540px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background: white;
    position: relative;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.08);
}

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

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

.login-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--imss-verde) 0%, var(--imss-verde-claro) 100%);
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 18px 45px rgba(0, 99, 65, 0.28);
    position: relative;
    overflow: hidden;
}

.login-icon::after {
    content: '';
    position: absolute;
    inset: -50px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: rotate(25deg) translateX(-150%);
    transition: transform 0.8s ease;
}

.login-icon:hover::after {
    transform: rotate(25deg) translateX(150%);
}

.login-icon i {
    font-size: 2.2rem;
    color: white;
    z-index: 1;
    position: relative;
}

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

.login-header h2 {
    font-size: 1.85rem;
    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.3rem;
}

.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: 1.05rem;
    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: 1.05rem;
    padding: 4px;
    transition: color 0.3s;
}

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

.meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--imss-verde);
    cursor: pointer;
}

.remember label {
    cursor: pointer;
    font-weight: 500;
}

.forgot a {
    color: var(--imss-verde);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.forgot a:hover {
    color: var(--imss-verde-profundo);
    text-decoration: underline;
}

.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);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--imss-verde-claro) 0%, var(--imss-verde) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.btn-login:hover::before {
    opacity: 1;
}

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

.btn-login > * {
    position: relative;
    z-index: 1;
}

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

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

.spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    display: none;
    animation: spin 0.8s linear infinite;
}

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

.note {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.note i {
    color: var(--imss-verde);
    margin-right: 6px;
}

.footer {
    position: absolute;
    bottom: 2rem;
    text-align: center;
    width: 100%;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== 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;
        box-shadow: none;
    }

    .footer {
        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%;
    }

    .meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}
