/* ── 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"] {
    -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 {
    color: #94a3b8;
}

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

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

/* First + last name side by side */
.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-text:         inherit;
    --ff-muted:        rgba(0,0,0,.55);
    --ff-input-bg:     rgba(0,0,0,.05);
    --ff-input-border: rgba(0,0,0,.15);
    --ff-input-focus:  rgba(37,99,235,.7);
    --ff-btn-bg:       #2563eb;
    --ff-btn-text:     #fff;
    --ff-btn-hover:    #1d4ed8;
    --ff-ring:         rgba(37,99,235,.18);

    color: var(--ff-text);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    margin: 0 !important;
    padding: 0;
    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-muted:        rgba(255,255,255,.60);
    --ff-input-bg:     rgba(255,255,255,.10);
    --ff-input-border: rgba(255,255,255,.22);
    --ff-input-focus:  rgba(255,255,255,.55);
    --ff-btn-bg:       #fff;
    --ff-btn-text:     #111827;
    --ff-btn-hover:    #f1f5f9;
    --ff-ring:         rgba(255,255,255,.15);
}

/* Inner layout */
.stcrm-footer-inner {
    align-items: start;
    display: grid !important;
    gap: 8px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    margin: 0 !important;
    padding: 0 !important;
    row-gap: 8px !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: 16px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 3px;
}

.stcrm-footer-desc {
    color: var(--ff-muted);
    font-size: 13px;
    line-height: 1.5;
    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%;
}

/* Email + button pill */
.stcrm-footer-row {
    align-items: stretch;
    background: var(--ff-input-bg);
    border: 1.5px solid var(--ff-input-border);
    border-radius: 13px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0;
    min-height: 52px;
    margin: 0 0 12px !important;
    margin-block-start: 0 !important;
    overflow: hidden;
    transition:
        border-color .15s ease,
        box-shadow   .15s ease;
}

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

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

.stcrm-footer-row input[type="email"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    box-sizing: border-box;
    color: var(--ff-text);
    font-family: inherit;
    font-size: 15px;
    height: 52px;
    line-height: 52px;
    margin: 0 !important;
    min-width: 0;
    outline: none;
    padding: 0 18px;
    width: 100%;
}

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

.stcrm-footer-btn {
    align-items: center;
    background: var(--ff-btn-bg);
    border: none;
    border-left: 1px solid rgba(255,255,255,.22);
    border-radius: 0;
    color: var(--ff-btn-text);
    cursor: pointer;
    display: inline-flex;
    flex-direction: row;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    gap: 7px;
    height: 52px;
    justify-content: center;
    letter-spacing: .01em;
    line-height: 1;
    margin: 0 !important;
    min-height: 52px;
    padding: 0 22px;
    transition: background .15s ease, transform .1s 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);
    transform: none; /* keep it flat in the footer */
}

.stcrm-footer-btn:active {
    opacity: .9;
}

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

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

.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: 560px) {
    .stcrm-footer-inner {
        gap: 10px !important;
        row-gap: 10px !important;
    }

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

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

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

    .stcrm-footer-row {
        display: grid;
        grid-template-columns: 1fr;
        border-radius: 12px;
        overflow: visible;
        background: none;
        border: none;
        gap: 12px;
        min-height: 0;
        margin-bottom: 16px;
    }

    .stcrm-footer-row::before {
        display: none;
    }

    .stcrm-footer-row:focus-within {
        border: none;
        box-shadow: none;
    }

    .stcrm-footer-row input[type="email"] {
        background: var(--ff-input-bg);
        border: 2px solid var(--ff-input-border);
        border-radius: 14px;
        font-size: 16px;
        height: 56px;
        line-height: 56px;
        padding: 0 20px;
    }

    .stcrm-footer-row input[type="email"]:focus {
        border-color: var(--ff-input-focus);
        box-shadow: 0 0 0 3px var(--ff-ring);
    }

    .stcrm-footer-btn {
        border-left: none;
        border-radius: 14px;
        font-size: 16px;
        gap: 10px;
        height: 58px;
        justify-content: center;
        min-height: 58px;
        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;
    }
}
