/*
 * Top Fice — membership form + payment shortcodes.
 * Hereda variables visuales de topfice-front.css (gold #C8A951, ink #1A1818,
 * cream #FAF8F4). Mantenemos la paleta porque estos shortcodes viven en el
 * mismo sitio que Ranking/Winners/Agency Profile.
 */

/* ============ FORM ============ */

.tf-membership-form-wrap {
    padding: 56px 0;
    background: #FAF8F4;
}
@media (max-width: 768px) {
    .tf-membership-form-wrap { padding: 32px 0; }
}

.tf-membership-card {
    background: #fff;
    border: 1px solid #E8E4DF;
    border-radius: 8px;
    padding: 40px 48px;
    max-width: 760px;
    margin: 0 auto;
}
@media (max-width: 600px) {
    .tf-membership-card { padding: 24px 20px; border-radius: 6px; }
}

.tf-membership-card-head { margin-bottom: 28px; }
.tf-membership-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 32px;
    line-height: 1.15;
    color: #1A1818;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
    font-weight: 700;
}
@media (max-width: 600px) {
    .tf-membership-title { font-size: 24px; }
}
.tf-membership-sub {
    font-size: 15px;
    line-height: 1.6;
    color: #6B6560;
    margin: 0;
}

.tf-form-error {
    background: #FBE6E6;
    border: 1px solid #F1B5B5;
    color: #B32D2E;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.tf-membership-form .tf-field { margin-bottom: 18px; }
/* El display:flex de .tf-field (topfice-front.css) pisa el [hidden] del UA
 * stylesheet; sin esta regla, el campo State (solo USA) queda siempre
 * visible aunque tenga el atributo hidden. Mismo workaround que ya usa
 * .tf-loader[hidden]. */
.tf-membership-form .tf-field[hidden] { display: none; }

/* Honeypot anti-bot: invisible para humanos, presente en el DOM y en el
 * tab order desactivado para que los bots crean que es un campo válido.
 * Evitamos display:none y visibility:hidden porque algunos bots detectan
 * esos flags y skipean el campo, anulando la trampa. */
.tf-hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}
.tf-hp-field input { width: 1px; height: 1px; }
.tf-form-row {
    display: grid;
    gap: 16px;
    margin-bottom: 0;
}
.tf-form-row-two { grid-template-columns: 1fr 1fr; }
.tf-form-row .tf-field { margin-bottom: 18px; }
/* Cuando el campo State (solo USA) está visible, la fila Country/State/City
 * pasa a 3 columnas en una sola línea. Sin esto, el tercer campo hace wrap
 * en la grid de 2 columnas y deja una celda vacía que desalinea el form.
 * La clase la togglean el render PHP (prefill) y el JS (change de país). */
.tf-form-row-two.tf-row-has-state { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) {
    .tf-form-row-two,
    .tf-form-row-two.tf-row-has-state { grid-template-columns: 1fr; }
}

.tf-membership-form .tf-field label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6B6560;
    margin-bottom: 6px;
    font-weight: 500;
}

/* Aseguramos consistencia con el resto del front sin pelearnos con el theme
 * para inputs nativos (type=text/email/url/tel). Selectores con prefijo
 * .topfice para subir specificity sobre reglas del theme. */
.topfice .tf-membership-form input[type="text"],
.topfice .tf-membership-form input[type="email"],
.topfice .tf-membership-form input[type="url"],
.topfice .tf-membership-form input[type="tel"],
.topfice .tf-membership-form input[type="number"],
.topfice .tf-membership-form select,
.topfice .tf-membership-form textarea {
    width: 100%;
    background: #fff;
    border: 1px solid #E8E4DF;
    color: #1A1818;
    padding: 12px 16px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-shadow: none;
}
.topfice .tf-membership-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%231A1818' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    padding-right: 36px;
    cursor: pointer;
}
/* Focus: usamos !important solo en outline/border/box-shadow porque algunos
 * themes WP definen `input[type="email"]:focus { outline: 2px solid #007cba }`
 * (el azul del admin) con specificity igual o mayor a la nuestra. Para el
 * estado focus no hay razón válida para que el theme nos pise, así que
 * forzamos. */
.topfice .tf-membership-form input[type="text"]:focus,
.topfice .tf-membership-form input[type="email"]:focus,
.topfice .tf-membership-form input[type="url"]:focus,
.topfice .tf-membership-form input[type="tel"]:focus,
.topfice .tf-membership-form input[type="number"]:focus,
.topfice .tf-membership-form select:focus,
.topfice .tf-membership-form textarea:focus,
.topfice .tf-membership-form input[type="text"]:focus-visible,
.topfice .tf-membership-form input[type="email"]:focus-visible,
.topfice .tf-membership-form input[type="url"]:focus-visible,
.topfice .tf-membership-form input[type="tel"]:focus-visible,
.topfice .tf-membership-form input[type="number"]:focus-visible,
.topfice .tf-membership-form select:focus-visible,
.topfice .tf-membership-form textarea:focus-visible {
    outline: none !important;
    border-color: #C8A951 !important;
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.18) !important;
}

.tf-membership-fineprint {
    margin: 20px 0 8px;
    color: #6B6560;
    font-size: 13px;
    line-height: 1.5;
    font-style: italic;
}

/* Bloque "Billing information" en el form público. Visualmente separado
 * del resto de campos para indicar que es información distinta (fiscal),
 * opcional al momento de aplicar, pero importante si la agencia gana. */
.tf-membership-billing {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #E8E4DF;
}
.tf-membership-billing-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: #1A1818;
    margin: 0 0 4px;
    letter-spacing: -0.2px;
}
.tf-membership-billing-sub {
    margin: 0 0 16px;
    font-size: 13px;
    color: #6B6560;
    line-height: 1.5;
}

/* Bloque legal al pie del form (replica el "CONDITIONS" del Google Form
 * original). Usa fondo cream + borde sutil para separarse del flow de
 * inputs sin gritar. */
.tf-membership-conditions {
    margin: 28px 0 24px;
    padding: 18px 22px;
    background: #FAF8F4;
    border: 1px solid #E8E4DF;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.6;
    color: #1A1818;
}
.tf-membership-conditions h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #6B6560;
    margin: 0 0 10px;
    font-weight: 700;
    font-family: inherit;
}
.tf-membership-conditions p {
    margin: 0 0 10px;
}
.tf-membership-conditions p:last-child {
    margin-bottom: 0;
}

.tf-form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Estado "enviando" del submit: spinner + bloqueo de interacción. La clase
 * la pone topfice-membership-form.js en el evento submit. */
.tf-membership-form .tf-btn-gold.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
    cursor: wait;
    padding-right: 52px;
}
.tf-membership-form .tf-btn-gold.is-loading::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(26, 24, 24, 0.25);
    border-top-color: #1A1818;
    border-radius: 50%;
    animation: tf-btn-spin 0.7s linear infinite;
}
@keyframes tf-btn-spin {
    to { transform: rotate(360deg); }
}

/* ============ THANK YOU PANEL ============ */

.tf-membership-thanks {
    text-align: center;
    padding-top: 56px;
    padding-bottom: 56px;
}
.tf-membership-thanks-icon {
    margin-bottom: 18px;
    display: inline-block;
}
.tf-membership-thanks .tf-membership-title { margin-bottom: 16px; }
.tf-membership-thanks .tf-membership-sub {
    max-width: 480px;
    margin: 0 auto;
}

/* ============ PAYMENT SHORTCODE ============ */

.tf-payment-wrap {
    background: #FAF8F4;
    padding: 56px 0;
}
@media (max-width: 768px) {
    .tf-payment-wrap { padding: 32px 0; }
}

.tf-payment-card {
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #E8E4DF;
    border-radius: 8px;
    padding: 48px;
    text-align: center;
}
@media (max-width: 600px) {
    .tf-payment-card { padding: 28px 20px; }
}
.tf-payment-card-success { border-color: #B5DCB7; }

.tf-payment-head { margin-bottom: 24px; }
.tf-payment-eyebrow {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #C8A951;
    margin-bottom: 14px;
    font-weight: 600;
}
.tf-payment-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 30px;
    line-height: 1.2;
    color: #1A1818;
    margin: 0 0 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
@media (max-width: 600px) {
    .tf-payment-title { font-size: 22px; }
}
.tf-payment-sub {
    font-size: 15px;
    line-height: 1.6;
    color: #6B6560;
    margin: 0;
}
.tf-payment-icon {
    margin-bottom: 18px;
    display: inline-block;
}

.tf-payment-amount-box {
    margin: 32px auto 28px;
    padding: 22px 28px;
    background: #FAF8F4;
    border: 1px solid #E8E4DF;
    border-radius: 6px;
    display: inline-block;
    text-align: left;
    min-width: 240px;
}
.tf-payment-amount-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #6B6560;
    margin-bottom: 6px;
    font-weight: 600;
}
.tf-payment-amount-value {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 28px;
    font-weight: 700;
    color: #1A1818;
    line-height: 1;
}

.tf-payment-buttons {
    display: flex;
    gap: 32px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    margin: 8px 0 0;
}
.tf-pay-form { margin: 0; padding: 0; display: block; }

/* Cada "opción de pago" es una columna: botón arriba, logos de tarjetas
 * acceptadas abajo. El strip de logos queda fuera del botón porque adentro
 * compite con el label y se ve apretado. */
.tf-pay-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Specificity bumpeada con .topfice + selectores type-aware (<a> y <button>)
 * porque por default los browsers + themes WP pintan `<button type="submit">`
 * con color de marca azul. Sin esto el botón de PayPal se ve distinto al
 * de Credit Card aunque tengan la misma class. */
.topfice .tf-pay-btn,
.topfice a.tf-pay-btn,
.topfice button.tf-pay-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #1A1818 !important;
    color: #C8A951 !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 16px 40px !important;
    min-width: 200px;
    cursor: pointer;
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: transform .15s ease, background .15s ease, color .15s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.10);
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.2;
    box-sizing: border-box;
}
.topfice .tf-pay-btn:hover,
.topfice .tf-pay-btn:focus,
.topfice a.tf-pay-btn:hover,
.topfice button.tf-pay-btn:hover,
.topfice button.tf-pay-btn:focus {
    background: #2B2828 !important;
    color: #E8D08A !important;
    transform: translateY(-1px);
    text-decoration: none !important;
    outline: none;
}
.tf-pay-btn-label {
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0.18em;
    display: inline-block;
}

/* Strip de logos de tarjetas (Visa, MC, Maestro, Amex) — imagen oficial
 * del cliente, debajo de cada botón. */
.tf-card-logos {
    display: block;
    height: 22px;
    width: 150px;
    max-width: 100%;
    object-fit: contain;
}

.tf-payment-fineprint {
    margin-top: 32px;
    font-size: 12px;
    line-height: 1.6;
    color: #6B6560;
    font-style: italic;
}
