@import 'colors.css';

/* ============================================================
   ESTILOS GLOBALES
   ============================================================ */
body {
    background-image: url("../media/fondo-rifa.jpeg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    min-height: 100vh;
    font-family: 'MiFuente', 'Franklin Gothic Medium', Arial, sans-serif;
}

/* ============================================================
   SECCIÓN CONTENEDORA
   ============================================================ */
.sect-contact-form {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.contact-form-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
}

/* ============================================================
   CARD DEL FORMULARIO
   ============================================================ */
.form-container {
    background-color: #2f2f2f;
    border-radius: 8px;
    box-shadow:
        rgb(31 31 31 / 17%) 0px -23px 25px 0px inset,
        rgb(108 108 108 / 23%) 0px -36px 30px 0px inset,
        rgba(0, 0, 0, 0.1) 0px -79px 40px 0px inset,
        rgba(0, 0, 0, 0.06) 0px 2px 1px,
        rgba(0, 0, 0, 0.09) 0px 4px 2px,
        rgba(0, 0, 0, 0.09) 0px 8px 4px,
        rgba(0, 0, 0, 0.09) 0px 16px 8px,
        rgba(0, 0, 0, 0.09) 0px 32px 16px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

/* ============================================================
   FORM
   ============================================================ */
form {
    display: flex;
    flex-direction: column;
    background-color: transparent;
    gap: 0;
}

form label {
    font-family: 'MiFuente', sans-serif;
    font-size: 14px;
    color: var(--blanco);
    text-align: left;
    margin-bottom: 6px;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="tel"],
form input[type="number"] {
    background: none;
    border: 1px solid #353535;
    padding: 15px 23px;
    font-size: 16px;
    border-radius: 8px;
    color: #979797;
    width: 100%;
    box-sizing: border-box;
    box-shadow:
        rgb(136 136 136 / 17%) 0px -23px 25px 0px inset,
        rgb(81 81 81 / 23%) 0px -36px 30px 0px inset,
        rgba(0, 0, 0, 0.1) 0px -79px 40px 0px inset,
        rgba(0, 0, 0, 0.06) 0px 2px 1px,
        rgba(0, 0, 0, 0.09) 0px 4px 2px,
        rgba(0, 0, 0, 0.09) 0px 8px 4px,
        rgba(0, 0, 0, 0.09) 0px 16px 8px,
        rgba(0, 0, 0, 0.09) 0px 32px 16px;
    font-family: 'MiFuente', sans-serif;
    margin: 0 0 20px 0;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form input[type="tel"]:focus,
form input[type="number"]:focus {
    border-color: var(--rojo);
    outline: none;
}

/* ============================================================
   CHECKBOX
   ============================================================ */
.consent {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    margin: 5px 0 20px 0;
    gap: 10px;
}

.consent input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--rojo);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    background-color: transparent;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    margin: 0;
    box-shadow: none;
}

.consent input[type="checkbox"]:checked {
    background-color: var(--rojo);
}

.consent input[type="checkbox"]:checked::after {
    content: "✓";
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
}

.consent input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px var(--rojo);
}

.consent p {
    color: var(--blanco);
    font-size: 12px;
    font-weight: 400;
    font-family: 'MiFuente', sans-serif;
    text-align: left;
    overflow-y: scroll;
    height: 60px;
    width: 90%;
    cursor: pointer;
    margin: 0;
}

.terms-link {
    color: var(--azul2);
    text-decoration: none;
}

.terms-link:hover {
    color: var(--azul1);
}

/* ============================================================
   BOTÓN SUBMIT
   ============================================================ */
.submit-btn {
    padding: 15px;
    border: none;
    border-radius: 8px;
    background-color: var(--rojo);
    color: var(--blanco);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: 'MiFuente', sans-serif;
    width: 100%;
}

.submit-btn:hover {
    background-color: var(--azul);
}

/* ============================================================
   ERROR
   ============================================================ */
.error-message-off { display: none; }

.error-message-on {
    color: var(--blanco);
    font-weight: 400;
    font-size: 14px;
    margin-bottom: 15px;
    font-family: 'MiFuente', sans-serif;
    background-color: var(--rojo);
    border-radius: 6px;
    padding: 10px;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb {
    background-color: var(--rojo);
    border-radius: 5px;
}

/* ============================================================
   LABELS EVENTO
   ============================================================ */
.form-event-label {
    display: block;
    background-color: var(--rojo);
    color: var(--blanco);
    font-size: 13px;
    font-family: 'MiFuente', sans-serif;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ============================================================
   INPUT TELÉFONO CON PREFIJO
   ============================================================ */
.phone-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #353535;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow:
        rgb(136 136 136 / 17%) 0px -23px 25px 0px inset,
        rgb(81 81 81 / 23%) 0px -36px 30px 0px inset,
        rgba(0, 0, 0, 0.1) 0px -79px 40px 0px inset;
}

.phone-prefix {
    background-color: var(--rojo);
    color: var(--blanco);
    padding: 15px 14px;
    font-size: 16px;
    font-family: 'MiFuente', sans-serif;
    font-weight: 600;
    white-space: nowrap;
    border-right: 1px solid #555;
}

.phone-wrapper input[type="tel"] {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    flex: 1;
    padding: 15px 14px !important;
    font-size: 16px !important;
    color: #979797 !important;
    font-family: 'MiFuente', sans-serif !important;
    outline: none !important;
    width: 100% !important;
}

.phone-wrapper:focus-within {
    border-color: var(--rojo);
}

/* ============================================================
   MODAL TÉRMINOS
   ============================================================ */
.popup-terms {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.popup-terms.active-terms {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.popup-terms-content {
    transform: scale(0.85);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
}

.popup-terms.active-terms .popup-terms-content {
    transform: scale(1);
    opacity: 1;
}

.terms-container {
    background-color: #2f2f2f;
    border-radius: 8px;
    box-shadow:
        rgb(31 31 31 / 17%) 0px -23px 25px 0px inset,
        rgb(108 108 108 / 23%) 0px -36px 30px 0px inset,
        rgba(0, 0, 0, 0.09) 0px 16px 8px,
        rgba(0, 0, 0, 0.09) 0px 32px 16px;
    padding: 30px;
    width: 100%;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.terms-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #444;
    flex-shrink: 0;
}

.terms-title {
    color: var(--blanco);
    font-size: 18px;
    font-weight: 600;
    font-family: 'MiFuente', sans-serif;
}

.terms-subtitle {
    color: #979797;
    font-size: 12px;
    font-family: 'MiFuente', sans-serif;
    margin-top: 4px;
}

.terms-body {
    overflow-y: auto;
    flex: 1;
    padding-right: 6px;
    color: #ccc;
    font-size: 13px;
    font-family: 'MiFuente', sans-serif;
    line-height: 1.7;
    text-align: left;
}

.terms-body h3 {
    color: var(--rojo);
    font-size: 13px;
    font-weight: 600;
    margin: 16px 0 8px 0;
    letter-spacing: 0.5px;
}

.terms-body p {
    margin-bottom: 12px;
}

.terms-body ol {
    padding-left: 18px;
    margin-bottom: 12px;
}

.terms-body ol li {
    margin-bottom: 6px;
}

.terms-iframe {
    width: 100%;
    flex: 1;
    border: none;
    border-radius: 4px;
    min-height: 340px;
    background: transparent;
}

.terms-close-btn {
    margin-top: 20px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: var(--rojo);
    color: var(--blanco);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'MiFuente', sans-serif;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.terms-close-btn:hover {
    background-color: var(--azul);
}

/* ============================================================
   MODAL ÉXITO
   ============================================================ */
.popup-success {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.popup-success.active-success {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.popup-success-content {
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.popup-success.active-success .popup-success-content {
    transform: scale(1);
    opacity: 1;
}

.success-container {
    background-color: #2f2f2f;
    border-radius: 8px;
    box-shadow:
        rgb(31 31 31 / 17%) 0px -23px 25px 0px inset,
        rgb(108 108 108 / 23%) 0px -36px 30px 0px inset,
        rgba(0, 0, 0, 0.1) 0px -79px 40px 0px inset,
        rgba(0, 0, 0, 0.09) 0px 16px 8px,
        rgba(0, 0, 0, 0.09) 0px 32px 16px;
    padding: 40px;
    max-width: 380px;
    width: 90%;
    text-align: center;
}

.success-icon {
    font-size: 60px;
    color: var(--rojo);
    margin-bottom: 16px;
}

.success-heading {
    color: var(--blanco);
    font-size: 24px;
    font-weight: 500;
    font-family: 'MiFuente', sans-serif;
    margin-bottom: 10px;
}

.success-text {
    color: #979797;
    font-size: 15px;
    font-family: 'MiFuente', sans-serif;
    margin-bottom: 28px;
    line-height: 1.5;
}

.success-btn {
    padding: 14px 40px;
    border: none;
    border-radius: 8px;
    background-color: var(--rojo);
    color: var(--blanco);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'MiFuente', sans-serif;
    transition: background-color 0.3s ease;
    width: auto;
}

.success-btn:hover {
    background-color: var(--azul);
}

.success-event {
    display: inline-block;
    background-color: var(--rojo);
    color: var(--blanco);
    font-size: 13px;
    font-family: 'MiFuente', sans-serif;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

/* ============================================================
   RESPONSIVE — tablet
   ============================================================ */
@media (min-width: 600px) and (max-width: 1079px) {
    .form-container { max-width: 480px; padding: 40px; }
    form label { font-size: 18px; }
    form input[type="text"],
    form input[type="email"],
    form input[type="password"],
    form input[type="tel"],
    form input[type="number"] { font-size: 18px; padding: 14px 20px; }
    .submit-btn { font-size: 20px; padding: 16px; }
}

/* ============================================================
   RESPONSIVE — landscape móvil
   ============================================================ */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .sect-contact-form { align-items: flex-start; padding: 20px; }
    .form-container { padding: 24px; }
    form input[type="text"],
    form input[type="email"],
    form input[type="password"],
    form input[type="tel"],
    form input[type="number"] { padding: 10px 15px; font-size: 14px; margin-bottom: 12px; }
    .submit-btn { font-size: 14px; padding: 10px; }
    .consent p { height: 50px; }
}