/* Modal de Registro */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1500;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-content:has(#registroContainer:not(.hidden)) {
    max-width: 800px;
}


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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 2rem;
    color: #1a472a;
    margin: 0;
}

.modal-close {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    color: #333;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.registro-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.registro-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.registro-form label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.registro-form label span {
    color: #e74c3c;
}

.registro-form input,
.registro-form select {
    padding: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.registro-form input:focus,
.registro-form select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 0.3rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    font-weight: 400;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
}

.registro-button {
    padding: 1rem;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a472a;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.registro-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.registro-button:active {
    transform: translateY(0);
}

.login-link {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.login-link a {
    color: #1a472a;
    font-weight: 600;
    text-decoration: none;
}

.login-link a:hover {
    text-decoration: underline;
}

.registro-success {
    display: none;
    padding: 1rem;
    background: #27ae60;
    color: white;
    border-radius: 10px;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
}

.registro-success.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.registro-message {
    display: none;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
}

.registro-message.show {
    display: block;
    /*animation: slideDown 1s ease;*/
}

.registro-message.info {
    border:1px solid #595959;
    color: #595959;
    background:#f2f2f2;
}

.registro-message.success {
    border:1px solid #008000;
    background:#C9FFCA;
    color: #008000;
}

.registro-message.error {
    border:1px solid #CC0000;
    background:#F7CBCA;
    color:#CC0000;
}

.registro-message.alert {
    border:1px solid #9E9400;
    background:#FCF258;
    color:#9E9400;
}

/* Modal de Login (mismo estilo que registro) */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-form label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.login-form label span {
    color: #e74c3c;
}

.login-form input {
    padding: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.forgot-password {
    text-align: right;
    margin-top: -0.5rem;
}

.forgot-password a {
    color: #666;
    font-size: 0.85rem;
    text-decoration: none;
}

.forgot-password a:hover {
    color: #1a472a;
    text-decoration: underline;
}

.login-button {
    padding: 1rem;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a472a;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

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

.register-link {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.register-link a {
    color: #1a472a;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.register-link a:hover {
    text-decoration: underline;
}

.login-message {
    display: none;
    padding: 0.5rem 1rem;
    background: #27ae60;
    color: white;
    border-radius: 10px;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
}

.login-message.show {
    display: block;
    /*animation: slideDown 1s ease;*/
}

.login-message.info {
    border:1px solid #595959;
    color: #595959;
    background:#f2f2f2;
}

.login-message.success {
    border:1px solid #008000;
    background:#C9FFCA;
    color: #008000;
}

.login-message.error {
    border:1px solid #CC0000;
    background:#F7CBCA;
    color:#CC0000;
}

.login-message.alert {
    border:1px solid #9E9400;
    background:#FCF258;
    color:#9E9400;
}

/* Ocultar formularios según estado */
.modal-content .hidden {
    display: none;
}

/* Formulario de recuperación de contraseña */
.recovery-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.recovery-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recovery-form label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.recovery-form label span {
    color: #e74c3c;
}

.recovery-form input {
    padding: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.recovery-form input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.recovery-button {
    padding: 1rem;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a472a;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.recovery-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.recovery-button:active {
    transform: translateY(0);
}

.recovery-success {
    display: none;
    padding: 1rem;
    background: #27ae60;
    color: white;
    border-radius: 10px;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
}

.recovery-success.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.back-to-login {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.back-to-login a {
    color: #1a472a;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.back-to-login a:hover {
    text-decoration: underline;
}

.recovery-info {
    background: #e8f4f8;
    padding: 1rem;
    border-radius: 10px;
    color: #2c3e50;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.recovery-info strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #1a472a;
}

/* Formulario de cambio de contraseña */
.reset-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.reset-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reset-form label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.reset-form label span {
    color: #e74c3c;
}

.reset-form input {
    padding: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.reset-form input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.reset-button {
    padding: 1rem;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a472a;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.reset-button:active {
    transform: translateY(0);
}

.reset-message {
    display: none;
    /*padding: 1rem;
    background: #27ae60;
    color: white;*/
    padding: 0.5rem 1rem;
    border-radius: 10px;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
}

.reset-success.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.reset-message.success {
    border:1px solid #008000;
    background:#C9FFCA;
    color: #008000;
}

.reset-message.error {
    border:1px solid #CC0000;
    background:#F7CBCA;
    color:#CC0000;
}


.reset-error {
    display: none;
    padding: 1rem;
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
}

.reset-error.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.reset-info {
    background: #e8f4f8;
    padding: 1rem;
    border-radius: 10px;
    color: #2c3e50;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.reset-info strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #1a472a;
}

.password-requirements {
    background: #fff9e6;
    border-left: 4px solid #ffd700;
    padding: 1rem;
    border-radius: 5px;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.password-requirements ul {
    margin: 0.5rem 0 0 1.2rem;
    padding: 0;
}

.password-requirements li {
    margin: 0.3rem 0;
    transition: color 0.3s ease;
}

.password-requirements li.valid {
    color: #27ae60;
    font-weight: 600;
}

.password-requirements li.valid::before {
    content: '✓ ';
    font-weight: bold;
}

.password-requirements li.invalid {
    color: #e74c3c;
}

.password-requirements li.invalid::before {
    content: '✗ ';
    font-weight: bold;
}

/* Contenedor de password con icono de mostrar/ocultar */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.3s ease;
    font-size: 1.2rem;
}

.toggle-password:hover {
    color: #1a472a;
}

.toggle-password:focus {
    outline: none;
}

/* Iconos de ojo usando Unicode */
.eye-icon::before {
    content: '👁️';
}

.eye-slash-icon::before {
    content: '👁️‍🗨️';
}

/* Icono de información y tooltip */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
    margin-left: 0.5rem;
    position: relative;
    transition: background 0.3s ease;
}

.info-icon:hover {
    background: #2980b9;
}

.info-icon::before {
    content: 'i';
    font-style: italic;
}

/* Tooltip */
.tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #c7dffb;
    color: #007efd;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: normal;
    width: 250px;
    max-width: calc(100vw - 40px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: none;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
}

/* Tooltip posicionado a la derecha cuando está muy a la izquierda */
.info-icon.align-right .tooltip {
    left: 0;
    transform: translateX(0);
}

.info-icon.align-right .tooltip::after {
    left: 20px;
}

/* Tooltip posicionado a la izquierda cuando está muy a la derecha */
.info-icon.align-left .tooltip {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.info-icon.align-left .tooltip::after {
    left: auto;
    right: 20px;
}

/* Tooltip posicionado abajo cuando está muy arriba */
.info-icon.align-bottom .tooltip {
    bottom: auto;
    top: calc(100% + 10px);
}

.info-icon.align-bottom .tooltip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #2c3e50;
}

.info-icon:hover .tooltip,
.info-icon.active .tooltip {
    opacity: 1;
    visibility: visible;
}

.label-with-info {
    display: flex;
    align-items: center;
}

/* Responsive para tooltips en móvil */
@media (max-width: 968px) {
    .tooltip {
        width: 200px;
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
        max-width: calc(100vw - 60px);
    }
}

/* Contenedor de reCAPTCHA */
.recaptcha-container {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.recaptcha-error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.recaptcha-error.show {
    display: block;
}