﻿/* ================================================
   COMPONENTES DE FORMULARIOS
   Inputs, Labels, Validación - Sport Frances
   ================================================ */

/* ===== FORM GROUPS ===== */
.form-group {
    margin-bottom: clamp(12px, 2.5vh, 16px);
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 7px;
    color: #333;
    font-size: clamp(12.5px, 3.2vw, 14px);
    font-weight: 600;
}

/* ===== INPUT GROUPS CON ICONOS ===== */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: clamp(12px, 3vw, 14px);
    top: 50%;
    transform: translateY(-50%);
    color: #4a7ba7;
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .input-icon svg {
        width: clamp(14px, 3.5vw, 15px);
        height: clamp(14px, 3.5vw, 15px);
        stroke-width: 2;
    }

.toggle-password {
    position: absolute;
    right: clamp(12px, 3vw, 14px);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #4a7ba7;
    cursor: pointer;
    padding: 8px;
    z-index: 1;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .toggle-password svg {
        width: clamp(14px, 3.5vw, 15px);
        height: clamp(14px, 3.5vw, 15px);
        stroke-width: 2;
    }

    .toggle-password:hover {
        color: #3a6a97;
    }

    .toggle-password:focus {
        outline: 2px solid #4a7ba7;
        outline-offset: 2px;
    }

/* ===== INPUTS ===== */
.form-control {
    width: 100%;
    padding: clamp(11px, 2.5vh, 14px) clamp(40px, 10vw, 46px);
    border: 2px solid #B8D4E6;
    border-radius: clamp(10px, 2.5vw, 12px);
    font-size: clamp(14.5px, 3.8vw, 16px);
    background: #E8F4F8;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
}

    .form-control.with-toggle {
        padding-right: clamp(40px, 10vw, 46px);
    }

    .form-control:focus {
        outline: none;
        border-color: #4a7ba7;
        background: #ffffff;
        box-shadow: 0 0 0 3px rgba(74, 123, 167, 0.15);
    }

    .form-control::placeholder {
        color: #adb5bd;
    }

    .form-control:disabled {
        background-color: #f8f9fa;
        cursor: not-allowed;
        opacity: 0.6;
    }

/* Validación de errores */
.input-validation-error {
    border-color: #e53e3e !important;
    background-color: #fff5f5 !important;
}

.text-danger,
.field-validation-error {
    color: #c53030;
    font-size: clamp(11.5px, 3vw, 12.5px);
    margin-top: 5px;
    display: block;
}

.validation-summary-errors {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border-left: 4px solid #e53e3e;
    border-radius: clamp(8px, 2vw, 10px);
    padding: clamp(10px, 2.5vh, 12px) 14px;
    margin-bottom: clamp(14px, 2.5vh, 16px);
}

    .validation-summary-errors ul {
        list-style: none;
        padding: 0;
        margin: 0;
        color: #c53030;
        font-size: clamp(12.5px, 3.2vw, 14px);
    }

    .validation-summary-errors li {
        margin-bottom: 4px;
    }

/* ===== CHECKBOX ===== */
.form-check {
    display: flex;
    align-items: center;
    margin: 8px 0 clamp(12px, 2.5vh, 16px);
}

    .form-check input[type="checkbox"] {
        width: 19px;
        height: 19px;
        cursor: pointer;
        accent-color: #4a7ba7;
        flex-shrink: 0;
        margin: 0 9px 0 0;
    }

    .form-check label {
        color: #666;
        font-size: clamp(12.5px, 3.2vw, 14px);
        cursor: pointer;
        user-select: none;
        margin: 0;
    }

/* Compatibilidad con ASP.NET CheckBox */
.remember-me {
    display: flex;
    align-items: center;
    gap: 9px;
}

    .remember-me input[type="checkbox"] {
        width: 19px;
        height: 19px;
        cursor: pointer;
        accent-color: #4a7ba7;
        flex-shrink: 0;
        margin: 0;
    }

    .remember-me label {
        color: #666;
        font-size: clamp(12.5px, 3.2vw, 14px);
        cursor: pointer;
        user-select: none;
        margin: 0;
    }

/* ===== MENSAJES DE ERROR ===== */
.error-message {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    color: #c53030;
    padding: clamp(10px, 2.5vh, 12px) 14px;
    border-radius: clamp(8px, 2vw, 10px);
    border-left: 4px solid #e53e3e;
    margin-bottom: clamp(14px, 2.5vh, 16px);
    font-size: clamp(12.5px, 3.2vw, 14px);
    display: none;
    align-items: center;
    gap: 9px;
}

    .error-message.show {
        display: flex;
    }

    .error-message i,
    .error-message svg {
        color: #e53e3e;
        flex-shrink: 0;
        width: 16px;
        height: 16px;
    }

/* ===== BOTONES DE FORMULARIO ===== */
.btn-login {
    width: 100%;
    padding: clamp(13px, 3vh, 16px);
    background: linear-gradient(135deg, #4a7ba7 0%, #5b8fb9 100%);
    color: #ffffff;
    border: none;
    border-radius: clamp(12px, 3vw, 14px);
    font-size: clamp(15px, 3.8vw, 17px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    min-height: 48px;
    box-shadow: 0 4px 15px rgba(74, 123, 167, 0.35);
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

    .btn-login:hover:not(:disabled) {
        background: linear-gradient(135deg, #3a6a97 0%, #4a7ba7 100%);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(74, 123, 167, 0.4);
    }

    .btn-login:active:not(:disabled) {
        transform: translateY(0);
    }

    .btn-login:disabled {
        opacity: 0.65;
        cursor: not-allowed;
        transform: none;
    }

    .btn-login:focus {
        outline: 2px solid #4a7ba7;
        outline-offset: 2px;
    }

/* Botón secundario */
.btn-secondary {
    width: 100%;
    padding: clamp(13px, 3vh, 16px);
    background: #e9ecef;
    color: #333;
    border: 2px solid #dee2e6;
    border-radius: clamp(12px, 3vw, 14px);
    font-size: clamp(15px, 3.8vw, 17px);
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

    .btn-secondary:hover:not(:disabled) {
        background: #dee2e6;
        transform: translateY(-1px);
    }

    .btn-secondary:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }

/* ===== FIX PARA iOS ===== */
@supports (-webkit-appearance: none) {
    .form-control {
        -webkit-appearance: none;
        -webkit-border-radius: clamp(10px, 2.5vw, 12px);
    }

    input[type="checkbox"] {
        -webkit-appearance: none;
        appearance: none;
        width: 19px;
        height: 19px;
        border: 2px solid #B8D4E6;
        border-radius: 4px;
        background: #E8F4F8;
        cursor: pointer;
        position: relative;
        flex-shrink: 0;
        transition: all 0.2s ease;
    }

        input[type="checkbox"]:checked {
            background: #4a7ba7;
            border-color: #4a7ba7;
        }

            input[type="checkbox"]:checked::after {
                content: '';
                position: absolute;
                left: 5px;
                top: 2px;
                width: 5px;
                height: 9px;
                border: solid white;
                border-width: 0 2px 2px 0;
                transform: rotate(45deg);
            }

        input[type="checkbox"]:focus {
            outline: 2px solid #4a7ba7;
            outline-offset: 2px;
        }
}

/* ===== RESPONSIVE - ALTURA BAJA ===== */
@media (max-height: 500px) {
    .form-group {
        margin-bottom: 10px;
    }

    .form-check {
        margin: 6px 0 10px;
    }
}

/* ===== RESPONSIVE - MÓVIL PEQUEÑO ===== */
@media (max-width: 360px) {
    .form-control {
        font-size: 14px;
    }

    .btn-login {
        font-size: 14px;
    }

    .form-check input[type="checkbox"] {
        width: 17px;
        height: 17px;
    }
}

/* ===== LANDSCAPE ESTRECHO ===== */
@media (orientation: landscape) and (max-height: 500px) {
    .form-group {
        margin-bottom: 8px;
    }

    .form-check {
        margin: 6px 0 8px;
    }

    .btn-login {
        padding: 11px;
        min-height: 44px;
    }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    .form-control,
    .btn-login,
    .btn-secondary,
    .toggle-password {
        transition: none;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 3px;
    }

    .btn-login {
        border: 2px solid white;
    }
}
