/* ==========================================================================
   MetaClinic – Popup Formulario Cita
   ========================================================================== */

/* --------------------------------------------------------------------------
   Utilidad: texto solo para lectores de pantalla
   -------------------------------------------------------------------------- */
.mc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Scroll lock – añadida por JS al abrir el popup
   -------------------------------------------------------------------------- */
body.mc-no-scroll {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Overlay / fondo oscuro
   -------------------------------------------------------------------------- */
.mc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: mc-fade-in 0.2s ease;
}

.mc-overlay[hidden] {
    display: none !important;
}

@keyframes mc-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.mc-modal {
    background: #2e3822;         /* Verde oliva oscuro — tono corporativo */
    border-radius: 6px;
    padding: 48px 40px 40px;
    width: 100%;
    max-width: 500px;
    position: relative;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: mc-slide-up 0.25s ease;
}

@keyframes mc-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* --------------------------------------------------------------------------
   Botón cerrar
   -------------------------------------------------------------------------- */
.mc-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 30px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s;
}

.mc-close:hover,
.mc-close:focus {
    color: #fff;
    outline: none;
}

/* --------------------------------------------------------------------------
   Título
   -------------------------------------------------------------------------- */
.mc-modal h2 {
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 28px;
    color: #fff;
    padding: 0;
    border: none;
}

/* --------------------------------------------------------------------------
   Mensaje de estado (éxito / error)
   -------------------------------------------------------------------------- */
.mc-msg {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.mc-msg[hidden] {
    display: none;
}

.mc-msg.success {
    background: rgba(130, 200, 130, 0.15);
    border: 1px solid rgba(130, 200, 130, 0.45);
    color: #a8e6a8;
}

.mc-msg.error {
    background: rgba(220, 80, 80, 0.15);
    border: 1px solid rgba(220, 80, 80, 0.4);
    color: #ffaaaa;
}

/* --------------------------------------------------------------------------
   Campos del formulario
   -------------------------------------------------------------------------- */
.mc-field {
    margin-bottom: 10px;
}

.mc-field input[type="text"],
.mc-field input[type="email"],
.mc-field input[type="tel"],
.mc-field textarea {
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    padding: 13px 16px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.mc-field input[type="text"]::placeholder,
.mc-field input[type="email"]::placeholder,
.mc-field input[type="tel"]::placeholder,
.mc-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.mc-field input:focus,
.mc-field textarea:focus {
    border-color: rgba(255, 255, 255, 0.85);
}

/* Indica campo inválido tras intento de envío */
.mc-field input.mc-invalid,
.mc-field textarea.mc-invalid {
    border-color: #e07070;
}

.mc-field textarea {
    resize: vertical;
    min-height: 120px;
}

/* --------------------------------------------------------------------------
   Checkbox + política de privacidad
   -------------------------------------------------------------------------- */
.mc-check-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 6px;
    margin-bottom: 6px;
}

.mc-check-field input[type="checkbox"] {
    width: 17px;
    min-width: 17px;
    height: 17px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #8fbc6a;
    border-radius: 3px;
}

.mc-check-field label {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    cursor: pointer;
}

.mc-check-field label a {
    color: #e05a5a;
    text-decoration: none;
    transition: opacity 0.15s;
}

.mc-check-field label a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.mc-required-mark {
    color: #e05a5a;
    margin-left: 2px;
}

/* --------------------------------------------------------------------------
   Botón de envío (dentro del formulario)
   -------------------------------------------------------------------------- */
.mc-submit-wrap {
    margin-top: 20px;
}

.mc-submit {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 40px;
    color: #fff;
    padding: 13px 40px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.mc-submit:hover,
.mc-submit:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    outline: none;
}

.mc-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Botón disparador del popup (shortcode)
   Adaptar según el contexto donde se inserte
   -------------------------------------------------------------------------- */
.mc-popup-trigger {
    display: inline-block;
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 40px;
    padding: 13px 40px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    color: inherit;          /* hereda el color del contexto donde esté */
}

.mc-popup-trigger:hover,
.mc-popup-trigger:focus {
    background: currentColor;
    border: 2px solid #EFEFEF;
}

/* Cuando el botón está sobre fondo oscuro (clase helper) */
.mc-popup-trigger.mc-light {
    color: #fff;
    border-color: #fff;
}

.mc-popup-trigger.mc-light:hover {
    background: #fff;
    color: #2e3822;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 520px) {
    .mc-modal {
        padding: 40px 22px 30px;
    }

    .mc-modal h2 {
        font-size: 1.1rem;
    }

    .mc-submit {
        width: 100%;
        text-align: center;
    }
}
