/* ═══════════════════════════════════════════════════════════════════════
   contacto.css — contact pages (/contacto.html, /en/contact.html,
   /de/kontakt.html, /fr/contact.html). Loaded AFTER styles.css.
   2026-11-08 | Calmer intro, a form card that never overflows (minmax(0,1fr)
   everywhere, 2 columns only from 900 px), 48 px controls with 16 px text
   (no iOS zoom), visible focus ring, inline field errors, compact spirit
   level with a big touch thumb, success panel and send-error fallbacks,
   no-JavaScript result notes (:target) and the back-to-top button hidden
   over the form on phones / tablets.
   The footer (footer-v3) is styled in styles.css, not here.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    --ct-navy: #0F172A;
    --ct-gold: #B08D57;
    --ct-slate: #334155;
    --ct-border: #E2E8F0;
    --ct-border-strong: #CBD5E1;   /* slate-300: inputs need more contrast than the card border */
    --ct-muted: #64748B;
    --ct-error: #B91C1C;
    --ct-ok: #15803D;
    --ct-ring: 0 0 0 3px rgba(176, 141, 87, 0.32);
}

/* ── Intro: H1 + subtitle + one short paragraph ───────────────────────── */
.contact-section.section-padding {
    padding: clamp(2.25rem, 6vw, 4.25rem) 0 clamp(3rem, 7vw, 5rem);
}

.contact-section h1 {
    text-align: center;
    font-size: clamp(1.7rem, 1.15rem + 2.3vw, 2.55rem);
    line-height: 1.18;
    margin: 0 auto 0.9rem;
    max-width: 22ch;
    text-wrap: balance;
}

.contact-section .section-subtitle {
    font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
    line-height: 1.6;
    color: var(--ct-slate);
    max-width: 640px;
    margin: 0 auto 0.85rem;
    text-wrap: pretty;
}

.contact-section .contacto-intro {
    max-width: 640px;
    margin: 0 auto clamp(1.5rem, 4vw, 2.25rem);
    text-align: center;
}

.contact-section .contacto-intro p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--ct-muted);
    opacity: 1;
    text-wrap: pretty;
}

.contact-section .contacto-intro strong {
    color: var(--ct-navy);
    font-weight: 500;
}

.contact-section .contacto-intro a {
    color: var(--ct-navy);
    text-decoration: underline;
    text-decoration-color: var(--ct-gold);
    text-underline-offset: 3px;
}

/* ── Card ─────────────────────────────────────────────────────────────── */
.contact-section .form-container {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    border-radius: 10px;
    border: 1px solid var(--ct-border);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.06);
}

/* ── Grid: one column, two from 900 px. minmax(0, 1fr) lets long <select>
      options shrink instead of widening the column (the tablet overflow). */
#contact-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.15rem;
    margin: 0;
    width: 100%;
    min-width: 0;
}

@media (min-width: 900px) {
    #contact-form {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1.25rem 1.25rem;
    }
}

#contact-form[hidden],
.form-success[hidden],
.field-error[hidden],
.level-error[hidden] {
    display: none !important;
}

#contact-form .form-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

#contact-form .form-group.full-width {
    grid-column: 1 / -1;
}

/* ── Labels: sentence case ────────────────────────────────────────────── */
#contact-form .form-group > label {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ct-navy);
    text-transform: none;
    letter-spacing: 0;
    margin: 0 0 0.4rem;
}

/* ── Controls: 48 px, 16 px text (no zoom on iOS) ────────────────────── */
#contact-form input[type="text"],
#contact-form input[type="email"],
#contact-form input[type="tel"],
#contact-form select,
#contact-form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: 48px;
    margin: 0;
    padding: 0 14px;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.3;
    color: var(--ct-navy);
    background-color: #fff;
    border: 1px solid var(--ct-border-strong);
    border-radius: 6px;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    scroll-margin-top: 120px;
}

#contact-form textarea {
    height: auto;
    min-height: 136px;
    padding: 12px 14px;
    line-height: 1.5;
    resize: vertical;
}

#contact-form select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23334155' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
}

#contact-form input::placeholder,
#contact-form textarea::placeholder {
    color: #94A3B8;
    opacity: 1;
}

#contact-form input[type="text"]:hover,
#contact-form input[type="email"]:hover,
#contact-form input[type="tel"]:hover,
#contact-form select:hover,
#contact-form textarea:hover {
    border-color: #94A3B8;
}

/* One focus ring for every control */
#contact-form input[type="text"]:focus,
#contact-form input[type="email"]:focus,
#contact-form input[type="tel"]:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--ct-gold);
    box-shadow: var(--ct-ring);
}

/* Validation states */
#contact-form input.input-valid {
    border-color: #16A34A;
    box-shadow: none;
}

#contact-form [aria-invalid="true"],
#contact-form input.input-invalid {
    border-color: #DC2626;
}

#contact-form [aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.field-error {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--ct-error);
    overflow-wrap: anywhere;
}

.field-hint {
    margin: 0.45rem 0 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--ct-muted);
    overflow-wrap: anywhere;
}

.field-hint a {
    color: var(--ct-navy);
    text-decoration: underline;
    text-decoration-color: var(--ct-gold);
    text-underline-offset: 2px;
}

/* ── Phone: prefix + number never overflow (beats styles.css !important) ── */
#contact-form .phone-field {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 48px;
    box-sizing: border-box;
    border: 1px solid var(--ct-border-strong);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#contact-form .phone-field:focus-within {
    border-color: var(--ct-gold);
    box-shadow: var(--ct-ring);
}

#contact-form .phone-field .phone-prefix-sel {
    flex: 0 0 auto !important;
    width: 7rem !important;
    max-width: 42% !important;
    min-width: 0 !important;
    height: 100% !important;
    padding: 0 26px 0 12px !important;
    border: 0 !important;
    border-right: 1px solid var(--ct-border) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 16px !important;
    background-color: #F8F6F1 !important;
    background-position: right 9px center !important;
    background-size: 10px 6px !important;
}

#contact-form .phone-field .phone-number-input {
    flex: 1 1 0% !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 100% !important;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
}

#contact-form .phone-field .phone-prefix-sel:focus,
#contact-form .phone-field .phone-number-input:focus {
    outline: none;
    box-shadow: none !important;
}

#contact-form .phone-field .phone-prefix-sel:focus {
    background-color: #EFEADF !important;
}

/* ── Honeypot: off-screen, not display:none ──────────────────────────── */
.hp-field {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ── Spirit level (compact) ──────────────────────────────────────────── */
#contact-form .level-captcha {
    gap: 0.6rem;
    padding: 1rem 1rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--ct-border);
    background: var(--bg-stone, #F8FAFC);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    scroll-margin-top: 120px;
}

#contact-form .level-captcha-lbl {
    font-size: 0.72rem;
    line-height: 1.45;
    opacity: 0.8;
}

#contact-form .level-scene {
    width: 100%;
    max-width: 380px;
}

#contact-form .level-frame canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

#contact-form .level-ctrl {
    width: 100%;
    max-width: 420px;
    gap: 12px;
    touch-action: pan-y;
}

/* Range: 36 px tall hit area, 6 px track, 30 px thumb */
#contact-form .level-range {
    -webkit-appearance: none;
    appearance: none;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 36px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;                       /* styles.css ".form-group input" would box the slider */
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

#contact-form .level-range:focus {
    outline: none;
    border: 0;
    box-shadow: none;
}

#contact-form .level-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(176, 141, 87, 0.28);
}

#contact-form .level-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    margin-top: -12px;
    border-radius: 50%;
    background: var(--ct-gold);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1.5px var(--ct-gold), 0 2px 8px rgba(176, 141, 87, 0.45);
    cursor: grab;
}

#contact-form .level-range:active::-webkit-slider-thumb {
    cursor: grabbing;
}

#contact-form .level-range:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 1.5px var(--ct-gold), 0 0 0 7px rgba(176, 141, 87, 0.35);
}

#contact-form .level-range::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(176, 141, 87, 0.28);
}

#contact-form .level-range::-moz-range-thumb {
    width: 30px;
    height: 30px;
    box-sizing: border-box;
    border-radius: 50%;
    background: var(--ct-gold);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1.5px var(--ct-gold), 0 2px 8px rgba(176, 141, 87, 0.45);
    cursor: grab;
}

#contact-form .level-range:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 1.5px var(--ct-gold), 0 0 0 7px rgba(176, 141, 87, 0.35);
}

#contact-form .level-status {
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--ct-slate);
}

#contact-form .level-status.ok {
    color: var(--ct-ok);
}

#contact-form .level-error {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--ct-error);
    text-align: center;
    overflow-wrap: anywhere;
}

#contact-form .level-captcha.level-attention {
    border-color: var(--ct-gold);
    animation: ctLevelPulse 1.6s ease-out 1;
}

@keyframes ctLevelPulse {
    0%   { box-shadow: 0 0 0 0 rgba(176, 141, 87, 0.55); }
    70%  { box-shadow: 0 0 0 12px rgba(176, 141, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(176, 141, 87, 0); }
}

/* ── Actions ──────────────────────────────────────────────────────────── */
#contact-form .form-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

#contact-form #submit-btn {
    width: 100%;
    max-width: 100%;
    min-height: 52px;
    padding: 0.9rem 1.25rem;
    white-space: normal;
    line-height: 1.3;
}

#contact-form #submit-btn:focus-visible {
    outline: 3px solid rgba(176, 141, 87, 0.6);
    outline-offset: 3px;
}

/* Only while sending (the button is otherwise always enabled) */
#contact-form #submit-btn:disabled {
    opacity: 0.72;
    cursor: progress;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

@media (min-width: 900px) {
    #contact-form .form-actions {
        align-items: center;
    }
    #contact-form #submit-btn {
        width: auto;
        min-width: 340px;
    }
}

#contact-form .form-message {
    width: 100%;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    text-align: center;
    overflow-wrap: anywhere;
}

#contact-form .form-message:empty {
    display: none;
}

#contact-form .form-message.error {
    color: var(--ct-error);
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    text-align: left;
}

#contact-form .form-message a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Success panel (replaces the fields after a send) ────────────────── */
.form-success {
    text-align: center;
    padding: clamp(1rem, 4vw, 2rem) clamp(0.25rem, 3vw, 1.5rem);
    scroll-margin-top: 120px;
}

.form-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(176, 141, 87, 0.14);
    color: var(--ct-gold);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.form-success-title {
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
    line-height: 1.25;
    margin: 0 0 0.75rem;
    outline: none;
}

.form-success p {
    max-width: 520px;
    margin: 0 auto 0.75rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ct-slate);
    overflow-wrap: anywhere;
}

.form-success a {
    color: var(--ct-navy);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--ct-gold);
    text-underline-offset: 3px;
}

.form-success-again {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    max-width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--ct-navy);
    border: 2px solid var(--ct-navy);
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: normal;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.form-success-again:hover {
    background: var(--ct-navy);
    color: #fff;
}

.form-success-again:focus-visible {
    outline: 3px solid rgba(176, 141, 87, 0.6);
    outline-offset: 3px;
}

/* ── Back-to-top: hidden while it would sit on the form card (< 900 px) ──
      main.js adds .over-form when the card passes through the bottom strip of
      the screen where the fixed button lives (it covered the submit button). */
@media (max-width: 899px) {
    .back-to-top.over-form,
    .footer-v3 .back-to-top.over-form {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* ── Notes after a send without JavaScript ───────────────────────────────
      send_mail.php redirects to ?enviado=1#form-enviado or ?enviado=0#form-fallo;
      :target shows the matching note with no script at all. */
.form-nojs-note {
    display: none;
}

.form-nojs-note:target,
.form-nojs-note.form-nojs-noscript {
    display: block;
    max-width: 760px;
    margin: 0 auto 1.25rem;
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.55;
    text-align: left;
    overflow-wrap: anywhere;
    scroll-margin-top: 120px;
    outline: none;
}

.form-nojs-ok:target {
    color: #14532D;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
}

.form-nojs-error:target {
    color: var(--ct-error);
    background: #FEF2F2;
    border: 1px solid #FECACA;
}

/* 2026-11-09 | The form no longer has an action (form-filling robots used it): without
      JavaScript a <noscript> hides it and shows this note with email and WhatsApp. */
.form-nojs-noscript {
    color: #7C2D12;
    background: #FFF7ED;
    border: 1px solid #FED7AA;
}

.form-nojs-note a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-nojs-note[hidden] {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    #contact-form .level-captcha.level-attention {
        animation: none;
        box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.45);
    }
    #contact-form input,
    #contact-form select,
    #contact-form textarea,
    #contact-form .phone-field,
    #contact-form .level-captcha {
        transition: none;
    }
}
