/* ── Homebrew CRM · Signup Form ───────────────────────────── */

.stcrm-signup-form {
    /* 4-px gradient accent at the top, white beneath */
    background:
        linear-gradient(90deg, #2563eb 0%, #7c3aed 100%)
        no-repeat top / 100% 4px,
        #ffffff;
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(15,23,42,.06),
        0 4px 6px -1px rgba(15,23,42,.06),
        0 20px 40px -8px rgba(15,23,42,.12);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    max-width: 520px;
    /* push content below the 4-px accent band + breathing room */
    padding: 40px 36px 36px;
    animation: stcrm-fade-up .35s ease both;
}

@keyframes stcrm-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ─────────────────────────────────────────────── */

.stcrm-form-title {
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.4px;
    line-height: 1.2;
    margin: 0 0 8px;
}

.stcrm-form-desc {
    color: #64748b;
    font-size: 14.5px;
    line-height: 1.65;
    margin: 0 0 26px;
}

/* ── Field grid ─────────────────────────────────────────── */

.stcrm-form-fields {
    display: grid;
    gap: 16px;
}

.stcrm-field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stcrm-field-group label {
    color: #334155;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.stcrm-required {
    color: #ef4444;
    margin-left: 2px;
}

/* ── Inputs ─────────────────────────────────────────────── */

.stcrm-signup-form input[type="email"],
.stcrm-signup-form input[type="text"],
.stcrm-signup-form input[type="tel"] {
    -webkit-appearance: none;
    appearance: none;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-sizing: border-box;
    color: #0f172a;
    font-family: inherit;
    font-size: 15px;
    height: 48px;
    outline: none;
    padding: 0 16px;
    transition:
        border-color .15s ease,
        background   .15s ease,
        box-shadow   .15s ease;
    width: 100%;
}

.stcrm-signup-form input[type="email"]::placeholder,
.stcrm-signup-form input[type="text"]::placeholder,
.stcrm-signup-form input[type="tel"]::placeholder {
    color: #94a3b8;
}

.stcrm-signup-form input[type="email"]:hover:not(:focus),
.stcrm-signup-form input[type="text"]:hover:not(:focus),
.stcrm-signup-form input[type="tel"]:hover:not(:focus) {
    border-color: #cbd5e1;
}

.stcrm-signup-form input[type="email"]:focus,
.stcrm-signup-form input[type="text"]:focus,
.stcrm-signup-form input[type="tel"]:focus {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

/* Selected fields */
.stcrm-field-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

.stcrm-field-group--wide {
    grid-column: 1 / -1;
}

/* Legacy first + last name row */
.stcrm-form-row {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

/* ── Consent block ──────────────────────────────────────── */

.stcrm-consent {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.stcrm-consent:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,.08);
}

.stcrm-consent label {
    align-items: flex-start;
    cursor: pointer;
    display: flex;
    gap: 12px;
    margin: 0;
}

.stcrm-consent input[type="checkbox"] {
    accent-color: #2563eb;
    flex-shrink: 0;
    height: 18px;
    margin: 2px 0 0;
    width: 18px;
}

.stcrm-consent span {
    color: #475569;
    font-size: 13.5px;
    line-height: 1.6;
}

/* ── CAPTCHA ────────────────────────────────────────────── */

.stcrm-captcha-wrapper {
    display: flex;
    justify-content: flex-start;
}

/* ── Submit button ──────────────────────────────────────── */

.stcrm-submit-btn {
    align-items: center;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    border: none;
    border-radius: 13px;
    box-shadow: 0 4px 14px rgba(37,99,235,.32);
    color: #fff;
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    gap: 8px;
    height: 52px;
    justify-content: center;
    letter-spacing: .02em;
    padding: 0 28px;
    transition:
        filter    .15s ease,
        transform .12s ease,
        box-shadow .15s ease;
    width: 100%;
}

.stcrm-submit-btn:hover {
    box-shadow: 0 8px 24px rgba(37,99,235,.42);
    filter: brightness(1.07);
    transform: translateY(-2px);
}

.stcrm-submit-btn:active {
    box-shadow: 0 2px 8px rgba(37,99,235,.22);
    filter: brightness(.97);
    transform: translateY(0);
}

/* Waiting for CAPTCHA to verify */
.stcrm-submit-btn:disabled,
.stcrm-submit-btn.stcrm-btn-waiting {
    cursor: not-allowed;
    filter: none;
    opacity: .5;
    transform: none !important;
}

.stcrm-footer-btn:disabled,
.stcrm-footer-btn.stcrm-btn-waiting {
    cursor: not-allowed;
    opacity: .5;
}

.stcrm-btn-text {
    display: block;
}

.stcrm-btn-arrow {
    display: inline-block;
    font-size: 18px;
    line-height: 1;
    transition: transform .15s ease;
}

.stcrm-submit-btn:hover .stcrm-btn-arrow {
    transform: translateX(5px);
}

/* Small privacy line under button */
.stcrm-form-privacy {
    color: #94a3b8;
    font-size: 12px;
    margin-top: -2px;
    text-align: center;
}

/* ── Status messages ────────────────────────────────────── */

.stcrm-form-message {
    align-items: flex-start;
    border-radius: 12px;
    display: flex;
    font-size: 14px;
    font-weight: 500;
    gap: 12px;
    line-height: 1.55;
    margin-bottom: 20px;
    padding: 14px 16px;
}

/* Icon pill */
.stcrm-form-message::before {
    border-radius: 999px;
    display: inline-flex;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 900;
    height: 20px;
    justify-content: center;
    line-height: 20px;
    margin-top: 1px;
    min-width: 20px;
    text-align: center;
}

.stcrm-form-message-confirm,
.stcrm-form-message-subscribed {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    color: #15803d;
}

.stcrm-form-message-confirm::before,
.stcrm-form-message-subscribed::before {
    background: #16a34a;
    color: #fff;
    content: '✓';
}

.stcrm-form-message-consent_error,
.stcrm-form-message-email_error,
.stcrm-form-message-nonce_error,
.stcrm-form-message-form_error,
.stcrm-form-message-captcha_error {
    background: #fff1f2;
    border: 1.5px solid #fecdd3;
    color: #9f1239;
}

.stcrm-form-message-consent_error::before,
.stcrm-form-message-email_error::before,
.stcrm-form-message-nonce_error::before,
.stcrm-form-message-form_error::before,
.stcrm-form-message-captcha_error::before {
    background: #e11d48;
    color: #fff;
    content: '!';
}

/* ── Honeypot (invisible to humans, visible to bots) ─────── */

.stcrm-hp {
    height: 0;
    left: -9999px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    width: 0;
}

/* ── Footer horizontal bar form ─────────────────────────── */

/*
  Works out-of-the-box on most backgrounds.
  Dark footer?  add theme="dark" to the shortcode:
    [stcrm_form id="1" theme="dark"]
*/

.stcrm-footer-form {
    /* CSS custom properties — override in your theme */
    --ff-surface:      #ffffff;
    --ff-text:         #0f172a;
    --ff-muted:        #64748b;
    --ff-input-bg:     #f8fafc;
    --ff-input-border: #e2e8f0;
    --ff-input-focus:  #2563eb;
    --ff-btn-bg:       linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --ff-btn-text:     #fff;
    --ff-btn-hover:    linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
    --ff-accent-color: #2563eb;
    --ff-ring:         rgba(37,99,235,.10);

    background:
        linear-gradient(90deg, #2563eb 0%, #7c3aed 100%)
        no-repeat top / 100% 3px,
        var(--ff-surface);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(15,23,42,.06),
        0 4px 6px -1px rgba(15,23,42,.06),
        0 18px 34px -12px rgba(15,23,42,.16);
    color: var(--ff-text);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    margin: 0 auto !important;
    max-width: 1080px;
    padding: 18px 20px 16px;
    width: 100%;
}

.stcrm-footer-form *,
.stcrm-footer-form *::before,
.stcrm-footer-form *::after {
    box-sizing: border-box;
}

/* Dark theme — white inputs on dark backgrounds */
.stcrm-footer-form--dark,
.stcrm-footer-form[data-theme="dark"] {
    --ff-surface:      #111827;
    --ff-text:         #ffffff;
    --ff-muted:        rgba(255,255,255,.68);
    --ff-input-bg:     rgba(255,255,255,.08);
    --ff-input-border: rgba(255,255,255,.20);
    --ff-input-focus:  rgba(255,255,255,.72);
    --ff-btn-bg:       #fff;
    --ff-btn-text:     #111827;
    --ff-btn-hover:    #f1f5f9;
    --ff-accent-color: #ffffff;
    --ff-ring:         rgba(255,255,255,.15);
}

/* Inner layout */
.stcrm-footer-inner {
    align-items: center;
    display: grid !important;
    gap: 16px !important;
    grid-template-columns: minmax(180px, .68fr) minmax(0, 2.32fr) !important;
    margin: 0 !important;
    padding: 0 !important;
    row-gap: 12px !important;
}

.stcrm-footer-header {
    align-self: start;
    margin: 0 !important;
    min-width: 0;
    padding: 0 !important;
}

.stcrm-footer-title {
    color: var(--ff-text);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 4px;
}

.stcrm-footer-desc {
    color: var(--ff-muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

/* Fields wrapper */
.stcrm-footer-fields-wrap,
.stcrm-footer-fields {
    align-self: start;
    display: block !important;
    margin: 0 !important;
    margin-block: 0 !important;
    min-width: 0;
    padding: 0 !important;
    padding-block: 0 !important;
    width: 100%;
}

.stcrm-footer-inner > .stcrm-footer-fields:first-child {
    grid-column: 1 / -1;
}

/* Selected fields + button */
.stcrm-footer-row {
    align-items: stretch;
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px !important;
    margin-block-start: 0 !important;
    min-height: 0;
}

.stcrm-footer-fields-wrap > .stcrm-footer-row:first-child,
.stcrm-footer-fields > .stcrm-footer-row:first-child {
    margin-top: 0 !important;
}

.stcrm-footer-field {
    background: var(--ff-input-bg);
    border: 1.5px solid var(--ff-input-border) !important;
    border-radius: 11px;
    flex: 1 1 128px;
    min-width: 0;
    overflow: hidden;
    transition:
        border-color .15s ease,
        box-shadow   .15s ease;
}

.stcrm-footer-field:focus-within {
    border-color: var(--ff-input-focus);
    box-shadow: 0 0 0 3px var(--ff-ring);
}

.stcrm-footer-field > .screen-reader-text {
    border: 0 !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}

.stcrm-footer-field input[type="email"],
.stcrm-footer-field input[type="text"],
.stcrm-footer-field input[type="tel"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box;
    color: var(--ff-text);
    font-family: inherit;
    font-size: 14px;
    height: 42px;
    line-height: 42px;
    margin: 0 !important;
    min-width: 0;
    outline: none;
    padding: 0 12px;
    width: 100%;
}

.stcrm-footer-field input[type="email"]::placeholder,
.stcrm-footer-field input[type="text"]::placeholder,
.stcrm-footer-field input[type="tel"]::placeholder {
    color: var(--ff-muted);
}

.stcrm-footer-btn {
    align-items: center;
    background: var(--ff-btn-bg);
    border: none !important;
    border-radius: 11px;
    box-shadow: 0 4px 14px rgba(37,99,235,.24);
    color: var(--ff-btn-text);
    cursor: pointer;
    display: inline-flex;
    flex-direction: row;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    flex: 0 0 auto;
    gap: 7px;
    height: 42px;
    justify-content: center;
    letter-spacing: .01em;
    line-height: 1;
    margin: 0 !important;
    min-height: 42px;
    padding: 0 18px;
    transition:
        filter .15s ease,
        transform .12s ease,
        box-shadow .15s ease;
    white-space: nowrap;
}

.stcrm-footer-btn-text,
.stcrm-footer-btn-arrow {
    display: inline-flex;
    line-height: 1;
}

.stcrm-footer-btn-arrow {
    font-size: 18px;
    transform: translateY(-1px);
}

.stcrm-footer-btn:hover {
    background: var(--ff-btn-hover);
    box-shadow: 0 8px 22px rgba(37,99,235,.34);
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.stcrm-footer-btn:active {
    box-shadow: 0 2px 8px rgba(37,99,235,.20);
    filter: brightness(.98);
    transform: translateY(0);
}

/* Consent checkbox */
.stcrm-footer-consent {
    align-items: center;
    color: var(--ff-muted);
    cursor: pointer;
    display: flex;
    font-size: 11.5px;
    gap: 8px;
    line-height: 1.4;
    margin: 0;
}

.stcrm-footer-consent input[type="checkbox"] {
    accent-color: var(--ff-accent-color);
    flex-shrink: 0;
    height: 15px;
    margin: 0;
    width: 15px;
}

.stcrm-footer-consent span {
    color: var(--ff-muted);
}

/* Status message inside footer form */
.stcrm-footer-form .stcrm-form-message {
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 12px;
    padding: 10px 14px;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 820px) {
    .stcrm-footer-form {
        max-width: 640px;
        padding: 18px;
    }

    .stcrm-footer-inner {
        align-items: stretch;
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 560px) {
    .stcrm-footer-inner {
        gap: 10px !important;
        row-gap: 10px !important;
    }

    .stcrm-signup-form {
        border-radius: 14px;
        padding: 32px 22px 28px;
    }

    .stcrm-field-grid,
    .stcrm-form-row {
        grid-template-columns: 1fr;
    }

    .stcrm-form-title {
        font-size: 19px;
    }

    .stcrm-footer-row {
        display: flex !important;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }

    .stcrm-footer-field input[type="email"],
    .stcrm-footer-field input[type="text"],
    .stcrm-footer-field input[type="tel"] {
        font-size: 16px;
        height: 48px;
        line-height: 48px;
        padding: 0 14px;
    }

    .stcrm-footer-btn {
        font-size: 14px;
        gap: 8px;
        height: 48px;
        justify-content: center;
        min-height: 48px;
        padding: 0 16px;
        width: 100%;
    }

    .stcrm-footer-btn-arrow {
        font-size: 22px;
        transform: translateY(-1px);
    }

    .stcrm-footer-consent {
        font-size: 13px;
        gap: 12px;
        line-height: 1.55;
    }

    .stcrm-footer-consent input[type="checkbox"] {
        height: 18px;
        margin-top: 1px;
        width: 18px;
    }
}
