/* ============================================ */
/* RESET & BASE */
/* ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --verde-oscuro: #0A1F0A;
    --verde-medio: #1B5E20;
    --verde-brillante: #2E7D32;
    --verde-claro: #4CAF50;
    --verde-lima: #66BB6A;
    --verde-neon: #81C784;
    --blanco: #FFFFFF;
    --blanco-humo: #F5F7F5;
    --rojo: #D32F2F;
    --rojo-oscuro: #B71C1C;
    --rojo-claro: #EF5350;
    --text: #1A1A1A;
    --text-light: #6B7A6B;
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.15);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--verde-oscuro);
    color: var(--blanco);
}

/* ============================================ */
/* VIDEO */
/* ============================================ */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
}

/* ============================================ */
/* PARTÍCULAS */
/* ============================================ */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--verde-claro), var(--verde-medio));
    opacity: 0.08;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0) scale(0.3);
        opacity: 0;
    }
    15% { opacity: 0.08; }
    85% { opacity: 0.08; }
    100% {
        transform: translateY(-10vh) translateX(60px) scale(1.2);
        opacity: 0;
    }
}

/* ============================================ */
/* TRIGGER - LOGO DE 320px */
/* ============================================ */
.trigger-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.trigger-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    text-align: center;
}

.trigger-image-wrapper {
    position: relative;
}

.trigger-image {
    max-width: 320px;
    width: 90%;
    height: auto;
    border-radius: 20px;
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.35));
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
}

.trigger-image:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.45));
}

.trigger-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 24px;
    border: 2px solid rgba(76, 175, 80, 0.25);
    animation: ringPulse 2.5s ease-in-out infinite;
    pointer-events: none;
}

.trigger-ring-delayed {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 24px;
    border: 2px solid rgba(76, 175, 80, 0.12);
    animation: ringPulse 2.5s ease-in-out 1.25s infinite;
    pointer-events: none;
}

@keyframes ringPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.12);
        opacity: 0.2;
    }
}

.trigger-hint {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--verde-neon);
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    padding: 8px 20px;
    border-radius: 40px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    animation: hintPulse 2s ease-in-out infinite;
    display: inline-block;
    text-align: center;
    width: auto;
    max-width: 100%;
}

.trigger-subhint {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    color: rgba(129, 199, 132, 0.5);
    text-transform: uppercase;
    margin-top: -6px;
    text-align: center;
    width: 100%;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

.trigger-container {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.trigger-container.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.8);
    pointer-events: none;
}

.trigger-container.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* ============================================ */
/* LOGIN CARD - FONDO MÁS CLARO */
/* ============================================ */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.96);
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    padding: 16px;
}

.login-container.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.login-container.hiding {
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.96);
}

.login-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-radius: 28px;
    width: 100%;
    max-width: 780px;
    padding: 32px 38px 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
}

.login-card::-webkit-scrollbar {
    width: 3px;
}
.login-card::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
}
.login-card::-webkit-scrollbar-thumb {
    background: var(--verde-claro);
    border-radius: 10px;
}

/* ============================================ */
/* HEADER - LOGO DE 120px */
/* ============================================ */
.login-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.header-logo {
    width: 120px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.header-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #FFFFFF;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
}

.brand-sub {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 3px;
    color: #A5D6A7;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.header-mode {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 14px 5px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.mode-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--verde-claro);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.mode-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

/* ============================================ */
/* TÍTULO */
/* ============================================ */
.login-title {
    margin-bottom: 24px;
}

.login-title h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

.login-title p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
    margin-top: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ============================================ */
/* INPUTS */
/* ============================================ */
.login-form, .register-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-row {
    display: flex;
    gap: 14px;
}

.input-row .input-group {
    flex: 1;
}

.input-group {
    width: 100%;
}

.input-field {
    position: relative;
    width: 100%;
}

.input-field .field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.input-field input,
.input-field select {
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    z-index: 1;
}

.input-field input::placeholder {
    color: transparent;
}

.input-field input:focus,
.input-field select:focus {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(76, 175, 80, 0.4);
}

.input-field input:focus ~ .field-line,
.input-field select:focus ~ .field-line {
    width: 100%;
}

.input-field input:focus ~ label,
.input-field input:not(:placeholder-shown) ~ label,
.input-field select:focus ~ label,
.input-field select:not(:placeholder-shown) ~ label {
    transform: translateY(-22px) scale(0.82);
    color: #66BB6A;
}

.input-field input:focus ~ .field-icon,
.input-field input:not(:placeholder-shown) ~ .field-icon {
    color: #66BB6A;
}

.input-field select:focus ~ label,
.input-field select:not(:placeholder-shown) ~ label {
    transform: translateY(-22px) scale(0.82);
    color: #66BB6A;
}

.input-field label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: 1;
    background: transparent;
    padding: 0 4px;
}

.input-field select {
    appearance: none;
    padding-right: 40px;
    cursor: pointer;
    color: #FFFFFF;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2366BB6A' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.input-field select option {
    background: #1A2A1A;
    color: #FFFFFF;
    padding: 8px;
}

.input-field select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234CAF50' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
}

.input-field .field-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--verde-claro), var(--verde-lima));
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 0 0 12px 12px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
    font-size: 14px;
    z-index: 2;
    padding: 4px;
}

.toggle-password:hover {
    color: var(--verde-claro);
}

/* ============================================ */
/* BOTONES */
/* ============================================ */
.login-btn {
    background: linear-gradient(135deg, var(--verde-medio), var(--verde-brillante));
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--blanco);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    margin-top: 4px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.6s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.35);
    border-color: rgba(76, 175, 80, 0.35);
}

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

.login-btn i {
    transition: transform 0.3s ease;
    font-size: 15px;
}

.login-btn:hover i {
    transform: translateX(5px);
}

.login-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.login-btn.loading .btn-text::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    border: 2px solid var(--blanco);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

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

.register-btn {
    background: linear-gradient(135deg, var(--rojo), var(--rojo-oscuro));
    border-color: rgba(211, 47, 47, 0.2);
}

.register-btn:hover {
    box-shadow: 0 8px 32px rgba(211, 47, 47, 0.35);
    border-color: rgba(211, 47, 47, 0.35);
}

/* ============================================ */
/* SWITCH ENTRE LOGIN Y REGISTRO */
/* ============================================ */
.form-switch {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}

.switch-btn {
    background: none;
    border: none;
    color: #66BB6A;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    padding: 0 4px;
    position: relative;
}

.switch-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #66BB6A;
    transition: width 0.3s ease;
}

.switch-btn:hover::after {
    width: 100%;
}

.switch-btn:hover {
    color: #81C784;
}

/* ============================================ */
/* REGLAS DE CONTRASEÑA */
/* ============================================ */
.password-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
    transition: all 0.3s ease;
    padding: 2px 0;
}

.rule-item .rule-bullet {
    font-size: 12px;
    transition: all 0.3s ease;
    display: inline-block;
}

.rule-item.completed .rule-bullet {
    color: #66BB6A;
}

.rule-item.completed {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================ */
/* MENSAJES */
/* ============================================ */
.message-container {
    margin-top: 0;
    min-height: 0;
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease, margin 0.3s ease;
}

.message-container:not(:empty) {
    height: auto;
    min-height: 44px;
    margin-top: 16px;
    overflow: visible;
}

.message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    animation: messageSlide 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.error {
    background: rgba(211, 47, 47, 0.2);
    color: #EF5350;
    border-left: 3px solid var(--rojo);
}

.message.success {
    background: rgba(76, 175, 80, 0.2);
    color: #81C784;
    border-left: 3px solid var(--verde-claro);
}

.message.fade-out {
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s ease;
}

.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #81C784;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.loading-message::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid var(--verde-claro);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.shake {
    animation: shakeCard 0.4s ease-in-out;
}

@keyframes shakeCard {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ============================================ */
/* FOOTER */
/* ============================================ */
.login-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.login-footer p {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.5px;
    line-height: 1.5;
}

.login-footer .footer-title {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 1px;
}

.login-footer .footer-title strong {
    font-weight: 700;
}

.login-footer .footer-copy {
    font-size: 9px;
    opacity: 0.5;
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */
@media (max-width: 768px) {
    .login-card {
        padding: 28px 24px 24px;
        border-radius: 24px;
        max-width: 100%;
    }

    .input-row {
        flex-direction: column;
        gap: 16px;
    }

    .login-title h2 {
        font-size: 20px;
    }

    .trigger-image {
        max-width: 250px;
    }

    .password-rules {
        grid-template-columns: 1fr 1fr;
        gap: 4px 12px;
        padding: 8px 14px;
    }
    
    .rule-item {
        font-size: 10px;
    }

    .brand-name {
        font-size: 12px;
    }

    .header-logo {
        width: 90px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 22px 16px 20px;
        border-radius: 20px;
        max-height: 95vh;
    }

    .login-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 18px;
    }

    .header-brand {
        width: 100%;
    }

    .brand-name {
        font-size: 11px;
    }

    .header-mode {
        align-self: flex-start;
    }

    .login-title h2 {
        font-size: 18px;
    }

    .login-title p {
        font-size: 12px;
    }

    .input-field input,
    .input-field select {
        padding: 12px 14px 12px 40px;
        font-size: 13px;
    }

    .input-field label {
        font-size: 13px;
        left: 40px;
    }

    .input-field .field-icon {
        left: 14px;
        font-size: 13px;
    }

    .trigger-image {
        max-width: 200px;
    }
    .trigger-hint {
        font-size: 10px;
        padding: 6px 14px;
    }
    .trigger-subhint {
        font-size: 9px;
    }

    .login-btn {
        padding: 12px 18px;
        font-size: 14px;
    }

    .login-footer .footer-title {
        font-size: 9px;
    }
    .login-footer .footer-copy {
        font-size: 8px;
    }

    .password-rules {
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 8px 12px;
    }

    .rule-item {
        font-size: 10px;
    }

    .header-logo {
        width: 70px;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 18px 12px 16px;
        border-radius: 16px;
    }

    .login-title h2 {
        font-size: 16px;
    }

    .trigger-image {
        max-width: 160px;
    }

    .brand-name {
        font-size: 10px;
    }

    .input-field input,
    .input-field select {
        padding: 10px 12px 10px 36px;
        font-size: 12px;
    }

    .input-field label {
        font-size: 12px;
        left: 36px;
    }

    .input-field .field-icon {
        left: 12px;
        font-size: 12px;
    }

    .login-footer .footer-title {
        font-size: 8px;
    }
    .login-footer .footer-copy {
        font-size: 7px;
    }

    .header-logo {
        width: 60px;
    }
}