:root {
    --primary-green: #2e8b57;
    --dark-green: #1e6b3a;
    --light-green: #e8f5e9;
    --accent-green: #4caf50;
    --emerald-green: #50c878;
    --forest-green: #228b22;
    --mint-green: #98fb98;
    --white: #ffffff;
    --text-dark: #333;
    --text-light: #f5f5f5;
    --glass-white: rgba(255, 255, 255, 0.9);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 15px 35px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: url('./../images/hero/landing.jpg') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-dark);
}

/* Filtro oscuro mejorado para mejor contraste */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(30, 107, 58, 0.7) 0%, 
        rgba(0, 0, 0, 0.8) 50%, 
        rgba(46, 139, 87, 0.6) 100%);
    z-index: -1;
}

.login-container {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.92) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 2px 4px rgba(46, 139, 87, 0.2);
    width: 90%;
    max-width: 800px;
    min-height: auto;
    padding: 30px 35px;
    border: 2px solid rgba(46, 139, 87, 0.2);
    overflow: visible;
    position: relative;
    animation: fadeInUp 0.8s ease-out;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--accent-green), 
        transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

@media (max-width: 768px) {
    .login-container {
        min-height: auto;
        padding: 25px 30px;
        max-width: 95%;
    }
    
    .login-logo {
        width: 280px;
        height: 105px;
    }
    
    .form-section {
        flex-direction: column;
        gap: 20px;
    }
    
    fieldset {
        padding: 18px;
    }
}

@media (max-width: 600px) {
    .login-container {
        min-height: auto;
        padding: 20px 25px;
    }
    
    .login-logo {
        width: 240px;
        height: 90px;
    }
    
    .form-group input, select {
        padding: 14px 18px 14px 40px;
    }
    
    .register-btn {
        padding: 16px 20px;
        font-size: 1rem;
    }
    
    legend {
        font-size: 1rem;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 18px 20px;
        margin: 10px;
    }
    
    .login-logo {
        width: 200px;
        height: 75px;
    }
    
    fieldset {
        padding: 15px;
    }
    
    .form-group input, select {
        padding: 12px 16px 12px 38px;
        font-size: 0.95rem;
    }
    
    .input-icon {
        left: 14px;
        font-size: 1rem;
    }
}

/* HEADER */
.login-header {
    text-align: center;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInDown 0.8s ease-out;
}

.login-logo {
    width: 320px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto 15px auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.login-header h2 {
    color: var(--white);
    margin-bottom: 8px;
    font-weight: 600;
}

.login-header p {
    color: var(--light-green);
    font-size: 0.95rem;
}

/* FORM */
.form-group {
    margin-bottom: 15px;
}

#register-form h2{
    text-align: center;
    color: var(--white);
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--dark-green);
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    letter-spacing: 0.02em;
    transition: var(--transition);
}

.form-group label:hover {
    color: var(--primary-green);
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
}

/* Contenedor principal del input + icono */
.input-wrapper {
    position: relative;
    flex-direction: column;
    display: flex;
    align-items: center; /* Centra verticalmente el icono */
    width: 100%;
}

/* Input */
.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 40px; /* Espacio izquierdo para el icono */
    border: none;
    border-radius: 10px;
}

/* Icono dentro del input */
.input-icon {
    position: absolute;
    left: 12px; /* Posición fija a la izquierda */
    color: var(--primary-green);
    pointer-events: none; /* Evita que interfiera con el input */
}

/* Mensaje de error (debajo del input-wrapper) */
.error-message {
    display: block;
    margin-top: 5px;
    color: #ff0000;
    font-size: 14px;
}

fieldset {
    border: 2px solid rgba(46, 139, 87, 0.2);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(248, 250, 252, 0.85) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 4px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

fieldset:hover {
    border-color: rgba(76, 175, 80, 0.3);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 4px 15px rgba(46, 139, 87, 0.15);
}

legend {
    padding: 10px 18px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    background: linear-gradient(135deg, 
        var(--dark-green) 0%, 
        var(--primary-green) 50%, 
        var(--accent-green) 100%);
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 4px 15px rgba(46, 139, 87, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

input, select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(46, 139, 87, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(255, 255, 255, 1) 100%);
    color: var(--text-dark);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.04),
        0 2px 6px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.5);
}

select:focus, input:focus {
    outline: none;
    border-color: var(--accent-green);
    background: var(--glass-white);
    box-shadow: 
        0 0 0 3px rgba(76, 175, 80, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.06),
        0 4px 12px rgba(46, 139, 87, 0.15);
    transform: translateY(-1px);
}

select:hover, input:hover {
    border-color: rgba(76, 175, 80, 0.4);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.06),
        0 2px 8px rgba(46, 139, 87, 0.1);
}

.form-group input {
    width: 100%;
    padding: 16px 20px 16px 45px;
    border: 2px solid rgba(46, 139, 87, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(255, 255, 255, 1) 100%);
    color: var(--text-dark);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.04),
        0 2px 6px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.5);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-green);
    background: var(--glass-white);
    box-shadow: 
        0 0 0 3px rgba(76, 175, 80, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.06),
        0 4px 12px rgba(46, 139, 87, 0.15);
    transform: translateY(-1px);
}

.form-group input:hover {
    border-color: rgba(76, 175, 80, 0.4);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.06),
        0 2px 8px rgba(46, 139, 87, 0.1);
}

.register-btn {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, 
        var(--primary-green) 0%, 
        var(--accent-green) 50%, 
        var(--forest-green) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 
        0 4px 15px rgba(46, 139, 87, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    margin-top: 10px;
}

.register-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s;
}

.register-btn:hover::before {
    left: 100%;
}

.register-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 25px rgba(46, 139, 87, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, 
        var(--accent-green) 0%, 
        var(--emerald-green) 50%, 
        var(--primary-green) 100%);
}

.register-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 6px 15px rgba(46, 139, 87, 0.3);
}

/* SELECT WRAPPER STYLES */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--primary-green);
    transition: var(--transition);
    font-size: 1rem;
}

.select-wrapper:hover::after {
    color: var(--accent-green);
    transform: translateY(-50%) scale(1.1);
}

.form-section {
    display: flex;
    flex-direction: row;
    gap: 25px; /* Espacio entre fieldsets */
    flex-wrap: wrap; /* Permite que se apilen en pantallas pequeñas */
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.form-section fieldset {
    flex: 1; /* Ocupa el mismo espacio horizontal */
    min-width: 0; /* Para evitar desbordes */
    animation: fadeInUp 0.6s ease-out both;
}

.form-section fieldset:nth-child(1) { animation-delay: 0.1s; }
.form-section fieldset:nth-child(2) { animation-delay: 0.2s; }

.form-group {
    margin-bottom: 18px;
    animation: fadeInUp 0.4s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }
.form-group:nth-child(5) { animation-delay: 0.3s; }
.form-group:nth-child(6) { animation-delay: 0.35s; }

.form-group {
    margin-bottom: 18px;
    animation: fadeInUp 0.4s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }
.form-group:nth-child(5) { animation-delay: 0.3s; }
.form-group:nth-child(6) { animation-delay: 0.35s; }

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-green);
    font-size: 1.1rem;
    transition: var(--transition);
}

.form-group:focus-within .input-icon {
    color: var(--accent-green);
    transform: translateY(-50%) scale(1.1);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    padding: 4px;
    border-radius: 4px;
}

.password-toggle:hover {
    color: var(--primary-green);
    background: rgba(46, 139, 87, 0.1);
    transform: translateY(-50%) scale(1.1);
}

/* OPTIONS */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: var(--light-green);
    font-size: 0.9rem;
}

.forgot-password {
    color: var(--accent-green);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* BUTTON */
.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(46, 139, 87, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--dark-green);
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 10px;
    animation: fadeInUp 0.6s ease-out 0.5s both;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.register-link {
    color: var(--primary-green);
    font-weight: 700;
    text-decoration: none;
    position: relative;
    transition: var(--transition);
    text-shadow: none;
}

.register-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background: linear-gradient(90deg, var(--accent-green), var(--emerald-green));
    transition: var(--transition);
    transform: translateX(-50%);
}

.register-link:hover {
    color: var(--accent-green);
    text-shadow: 0 1px 3px rgba(76, 175, 80, 0.3);
}

.register-link:hover::after {
    width: 100%;
}

/* PLACEHOLDERS CON MEJOR CONTRASTE */
input::placeholder, select::placeholder {
    color: rgba(51, 51, 51, 0.6);
    font-weight: 500;
}

input:focus::placeholder, select:focus::placeholder {
    color: rgba(51, 51, 51, 0.4);
}

/* MEJORAS ADICIONALES DE CONTRASTE */
.input-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 2px;
    margin-bottom: 5px;
}

/* TEXTO DE ERROR MAS VISIBLE */
.error-message {
    color: #d32f2f;
    background-color: rgba(255, 235, 238, 0.9);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(211, 47, 47, 0.3);
    margin-top: 5px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(211, 47, 47, 0.1);
}

/* Ticker Bar - Versión mejorada con bucle perfecto */
.ticker-s24 {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--dark-green);
    color: var(--light-green);
    padding: 12px 0;
    overflow: hidden;
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ticker-container {
    display: flex;
    width: max-content; /* Cambiado a max-content */
    animation: ticker-move 60s linear infinite; /* Velocidad más lenta */
}

.ticker__list {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 40px; /* Espaciado reducido */
    padding-right: 40px; /* Espacio entre elementos duplicados */
}

.ticker__item {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--white);
    flex-shrink: 0;
}

.ticker__item.stock-up {
    color: #4CAF50;
}

.ticker__item.stock-down {
    color: #F44336;
}

.stock-change {
    margin-left: 5px;
    font-size: 12px;
}

@keyframes ticker-move {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); /* Mover solo el 50% para coincidir con el contenido duplicado */
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}