/* ─── Zip Code Redirector — Frontend Widget ───────────────────────────────── */

.zcr-widget {
    display: inline-block;
    padding: 20px 24px;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
}

/* ── Headings ── */
.zcr-heading {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 14px;
    text-align: center;
    letter-spacing: -.01em;
}

/* ── Form Row ── */
.zcr-form-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.zcr-input-wrap {
    flex: 1;
    position: relative;
}

.zcr-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid transparent;
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
    letter-spacing: .04em;
}

.zcr-input:focus {
    border-color: var(--zcr-accent);
    box-shadow: 0 0 0 3px var(--zcr-accent-glow);
}

/* ── Button ── */
.zcr-btn {
    height: 48px;
    padding: 0 22px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: background .2s, transform .1s, box-shadow .2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-family: inherit;
    position: relative;
}

.zcr-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--zcr-btn-shadow);
}

.zcr-btn:active {
    transform: translateY(0);
}

.zcr-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.zcr-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: zcr-spin .65s linear infinite;
}

.zcr-btn.loading .zcr-btn-spinner { display: block; }
.zcr-btn.loading .zcr-btn-text    { display: none; }

@keyframes zcr-spin {
    to { transform: rotate(360deg); }
}

/* ── Error ── */
.zcr-error {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    min-height: 18px;
    text-align: center;
    opacity: 0;
    transition: opacity .2s;
}

.zcr-error.visible {
    opacity: 1;
}

/* ═══════════════════════════════════════════════
   THEME: DARK (default)
═══════════════════════════════════════════════ */
.zcr-theme-dark {
    --zcr-accent:      #e91e8c;
    --zcr-accent-glow: rgba(233,30,140,.18);
    --zcr-btn-shadow:  rgba(233,30,140,.4);
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
}

.zcr-theme-dark .zcr-heading {
    color: #ffffff;
}

.zcr-theme-dark .zcr-input {
    background: #252540;
    color: #ffffff;
    border-color: rgba(255,255,255,.12);
}

.zcr-theme-dark .zcr-input::placeholder {
    color: rgba(255,255,255,.38);
}

.zcr-theme-dark .zcr-btn {
    background: #e91e8c;
    color: #ffffff;
}

.zcr-theme-dark .zcr-btn:hover {
    background: #d4187e;
}

.zcr-theme-dark .zcr-error {
    color: #ff6b9d;
}

/* ═══════════════════════════════════════════════
   THEME: LIGHT
═══════════════════════════════════════════════ */
.zcr-theme-light {
    --zcr-accent:      #1a56db;
    --zcr-accent-glow: rgba(26,86,219,.14);
    --zcr-btn-shadow:  rgba(26,86,219,.3);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

.zcr-theme-light .zcr-heading {
    color: #1a202c;
}

.zcr-theme-light .zcr-input {
    background: #f7fafc;
    color: #1a202c;
    border-color: #cbd5e0;
}

.zcr-theme-light .zcr-input::placeholder {
    color: #a0aec0;
}

.zcr-theme-light .zcr-btn {
    background: #1a56db;
    color: #ffffff;
}

.zcr-theme-light .zcr-btn:hover {
    background: #1447c0;
}

.zcr-theme-light .zcr-error {
    color: #e53e3e;
}

/* ═══════════════════════════════════════════════
   THEME: BRAND (pink / magenta — matches screenshots)
═══════════════════════════════════════════════ */
.zcr-theme-brand {
    --zcr-accent:      #e91e8c;
    --zcr-accent-glow: rgba(233,30,140,.18);
    --zcr-btn-shadow:  rgba(233,30,140,.4);
    background: rgba(26,20,30,.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(233,30,140,.25);
    box-shadow: 0 8px 40px rgba(0,0,0,.4), 0 0 0 1px rgba(233,30,140,.1);
}

.zcr-theme-brand .zcr-heading {
    color: #e91e8c;
}

.zcr-theme-brand .zcr-input {
    background: rgba(255,255,255,.92);
    color: #1a1a2e;
    border-color: transparent;
}

.zcr-theme-brand .zcr-input::placeholder {
    color: #888;
}

.zcr-theme-brand .zcr-btn {
    background: #e91e8c;
    color: #ffffff;
}

.zcr-theme-brand .zcr-btn:hover {
    background: #d4187e;
}

.zcr-theme-brand .zcr-error {
    color: #ff6b9d;
}

/* ── Responsive ── */
@media (max-width: 400px) {
    .zcr-widget {
        padding: 16px;
    }

    .zcr-form-row {
        flex-direction: column;
    }

    .zcr-btn {
        width: 100%;
        justify-content: center;
        height: 46px;
    }

    .zcr-input {
        height: 46px;
    }
}

/* ── Shake animation (appended) ── */
@keyframes zcr-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.zcr-shake {
    animation: zcr-shake .45s ease-in-out;
}
