@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html,
body {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background-color: #FFFFFF;
    color: #0F172A;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Contenedor Split Screen Pantalla Completa (Formulario Izquierda | Hero Derecha) --- */
.split-screen-container {
    width: 100vw;
    min-height: 100vh;
    height: 100vh;
    display: grid;
    grid-template-columns: 1.18fr 1.02fr;
    background: #FFFFFF;
}

/* ==========================================================================
   PANEL IZQUIERDO: Formulario de Autenticación Pantalla Completa
   ========================================================================== */
.form-pane {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vh, 4rem) clamp(1.5rem, 4vw, 4rem);
    background: #FFFFFF;
    overflow-y: auto;
}

/* Logo y Marca FarmaAlert Arriba en la Esquina Superior Izquierda (Compacto) */
.form-brand-header {
    position: absolute;
    top: clamp(1.5rem, 3.5vh, 2.5rem);
    left: clamp(1.5rem, 3.5vw, 3.25rem);
    display: flex;
    align-items: center;
    gap: 1px;
    z-index: 10;
    text-decoration: none;
}

.brand-logo-img {
    height: 22px;
    width: 22px;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease;
}

.form-brand-header:hover .brand-logo-img {
    transform: scale(1.08);
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #5f199c;
    letter-spacing: -0.03em;
    line-height: 1;
}

.brand-title .brand-alert {
    color: #42166a;
}

/* Caja de contenido del formulario centrado */
.form-content-box {
    width: 100%;
    max-width: 440px;
    margin: auto;
    animation: formFadeIn 0.35s ease-out both;
}

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

/* Cabecera de Bienvenida con Proporción Óptima y Espaciado */
.form-hero-greeting {
    margin-bottom: 2.35rem;
    text-align: center;
}

.form-hero-title {
    font-size: 2.15rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.55rem;
}

.form-hero-subtitle {
    font-size: 0.90rem;
    color: #64748B;
    font-weight: 400;
    line-height: 1.55;
    max-width: 380px;
    margin: 0 auto;
}

/* Pill Tabs Switcher Centrado, 100% Simétrico y con Mayor Tamaño */
.pill-tabs {
    background: #F1F5F9;
    border-radius: 14px;
    padding: 5px;
    display: flex;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1.35rem;
}

.pill-tab {
    flex: 1;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: transparent;
    color: #64748B;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.pill-tab.active {
    background: #FFFFFF;
    color: #0F172A;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Selector de Avatar */
.avatar-upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
    gap: 4px;
}

.avatar-preview-wrapper {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
}

.avatar-preview-wrapper:hover {
    border-color: #10B981;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.2);
    transform: scale(1.03);
}

.avatar-preview-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.avatar-edit-btn {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #10B981;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #FFFFFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.avatar-preview-wrapper:hover .avatar-edit-btn {
    background: #059669;
    transform: scale(1.08);
}

.avatar-helper-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.71rem;
    color: #64748B;
    font-weight: 500;
}

.btn-remove-avatar {
    background: none;
    border: none;
    color: #EF4444;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.btn-remove-avatar:hover {
    color: #DC2626;
}

/* Dual Layer Inputs */
.input-group {
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 6.5px 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FFFFFF;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.input-group:hover {
    border-color: #CBD5E1;
}

.input-group:focus-within {
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.input-icon {
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.input-icon svg {
    width: 17px;
    height: 17px;
}

.input-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.input-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 1.5px;
}

.input-label {
    font-size: 0.66rem;
    font-weight: 600;
    color: #64748B;
    text-transform: capitalize;
    margin: 0;
    line-height: 1;
}

.field-error-badge {
    font-size: 0.69rem;
    font-weight: 600;
    color: #EF4444;
    font-family: inherit;
    line-height: 1;
    display: none;
    text-align: right;
    white-space: nowrap;
    animation: fadeIn 0.15s ease-out;
}

.input-group.input-error .field-error-badge {
    display: inline-block;
}

.input-field {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #0F172A !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    font-family: inherit !important;
    line-height: 1.25 !important;
}

.input-field::placeholder {
    color: #CBD5E1;
    font-weight: 400;
}

.input-action {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.btn-toggle-pass {
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-toggle-pass svg {
    width: 17px;
    height: 17px;
}

.btn-toggle-pass:hover {
    color: #10B981;
}

.status-badge {
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.status-badge.visible {
    opacity: 1;
    transform: scale(1);
}

.status-badge svg {
    width: 17px;
    height: 17px;
}

/* Medidor de Fuerza de Contraseña */
.password-strength-container {
    margin-top: -3px;
    margin-bottom: 0.65rem;
    padding: 0 2px;
    animation: fadeIn 0.2s ease-out;
}

.strength-bars-row {
    display: flex;
    gap: 4px;
    width: 100%;
    margin-bottom: 3px;
}

.strength-bar-segment {
    height: 3.5px;
    flex: 1;
    border-radius: 3px;
    background: #E2E8F0;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.strength-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.68rem;
    line-height: 1.2;
}

.strength-label-text {
    color: #64748B;
    font-weight: 500;
}

.strength-label-text strong {
    font-weight: 700;
    transition: color 0.25s ease;
}

.strength-hint {
    color: #94A3B8;
    font-size: 0.66rem;
}

/* Botón Continuar / Submit */
.btn-continue {
    background: linear-gradient(135deg, #4F4A8C 0%, #3d3875 100%);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.94rem;
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 5px 16px -2px rgba(81, 16, 185, 0.35);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.35rem;
}

.btn-continue:hover {
    background: linear-gradient(135deg, #332e61 0%, #332e61 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 9px 20px -2px rgba(75, 16, 185, 0.45);
}

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

/* Estados de error */
.input-group.input-error {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
}

.input-group.input-error:focus-within {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16) !important;
}

.input-group.input-error .input-icon {
    color: #EF4444 !important;
}

.input-group.input-error .input-icon svg {
    stroke: #EF4444 !important;
}

.input-group.input-error .input-label {
    color: #DC2626 !important;
}

.input-group.shake-anim {
    animation: inputShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes inputShake {
    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-4px);
    }

    40%,
    80% {
        transform: translateX(4px);
    }
}

/* Mensajes en línea */
.auth-inline-error {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    width: 100%;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #DC2626;
    margin: 0.25rem 0 0.85rem 0;
    box-sizing: border-box;
    animation: fadeInSlide 0.25s ease-out;
}

.auth-inline-error svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    stroke: #EF4444;
}

.auth-inline-success {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    width: 100%;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #059669;
    margin: 0 0 0.85rem 0;
    box-sizing: border-box;
    animation: fadeInSlide 0.25s ease-out;
}

.auth-inline-success svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    stroke: #10B981;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================================================
    PANEL DERECHO: Color Sólido Verde con Borde Izquierdo Redondeado
   ========================================================================== */
.hero-gradient-pane {
    height: 100vh;
    border-radius: 48px 0 0 48px;
    background-color: #10B981;
    position: relative;
    z-index: 2;
}

/* ==========================================================================
    RESPONSIVE (Móviles y Pantallas Pequeñas)
   ========================================================================== */
@media (max-width: 860px) {
    .split-screen-container {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }

    .form-brand-header {
        position: static;
        margin-bottom: 1.5rem;
    }

    .form-pane {
        height: auto;
        padding: 2.5rem 1.5rem;
        flex-direction: column;
        justify-content: flex-start;
    }

    .hero-gradient-pane {
        display: none;
    }
}

/* ==========================================================================
   PANEL DERECHO: Video Local Full Cover
   ========================================================================== */
.hero-gradient-pane {
    height: 100vh;
    width: 100%;
    position: relative;
    border-radius: 48px 0 0 48px;
    overflow: hidden; /* Corta el video para que respete las esquinas redondeadas */
    background-color: #0F172A;
    z-index: 2;
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Hace que el video se estire y llene todo el espacio sin dejar huecos */
    display: block;
}

.hero-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    height: 80%;
    pointer-events: none; /* Permite hacer clics a través del overlay si fuera necesario */
    z-index: 1;
}