/* ============================================================================
 * Smart Form Modal - Perfex CRM Plugin
 * Universal dynamic form modal with theme integration
 * ============================================================================ */

/* CSS Variables - Inherit from theme or style settings */
:root {
    --smart-form-primary: #2b65e8;
    --smart-form-primary-hover: #1d4ed8;
    --smart-form-button-bg: #2b65e8;
    --smart-form-button-text: #ffffff;
    --smart-form-card-bg: #ffffff;
    --smart-form-header-bg: #ffffff;
    --smart-form-text-main: #0F172A;
    --smart-form-text-muted: #64748B;
    --smart-form-input-bg: #F8FAFC;
    --smart-form-input-text: #0F172A;
    --smart-form-accent: #10B981;
    --smart-form-success: #10B981;
    --smart-form-radius: 16px;
    --smart-form-overlay-opacity: 0.75;
    --smart-form-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}


/* ============================================================================
 * Modal Overlay
 * ============================================================================ */

.smart-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, var(--smart-form-overlay-opacity, 0.75));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.smart-form-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================================================
 * Modal Container
 * ============================================================================ */

.smart-form-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.smart-form-modal.active {
    opacity: 1;
    visibility: visible;
}


/* ============================================================================
 * Modal Card
 * ============================================================================ */

.smart-form-card {
    background: var(--smart-form-card-bg);
    color: var(--smart-form-text-main);
    border-radius: var(--smart-form-radius);
    box-shadow: var(--smart-form-shadow);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    position: relative;
}

/* Shadow Depths */
.smart-form-card.shadow-none {
    box-shadow: none;
    border: 1px solid var(--smart-form-gray-200);
}

.smart-form-card.shadow-soft {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.smart-form-card.shadow-deep {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.smart-form-card.shadow-glow {
    box-shadow: 0 0 40px rgba(var(--smart-form-primary-rgb, 43, 101, 232), 0.2);
}

/* Entrance Animations */
.smart-form-card.slide_up {
    transform: translateY(40px);
}

.smart-form-card.fade {
    transform: translateY(0);
    opacity: 0;
}

.smart-form-card.zoom {
    transform: scale(0.8);
}

.smart-form-card.bounce {
    transform: translateY(100px);
}

.smart-form-modal.active .smart-form-card.slide_up {
    transform: translateY(0);
    opacity: 1;
}

.smart-form-modal.active .smart-form-card.fade {
    transform: translateY(0);
    opacity: 1;
}

.smart-form-modal.active .smart-form-card.zoom {
    transform: scale(1);
    opacity: 1;
}

.smart-form-modal.active .smart-form-card.bounce {
    transform: translateY(0);
    opacity: 1;
    transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Glassmorphism Condition */
body.sf-glass-enabled .smart-form-card {
    background: color-mix(in srgb, var(--smart-form-card-bg) 85%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}


/* ============================================================================
 * Close Button
 * ============================================================================ */

.smart-form-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: color-mix(in srgb, var(--smart-form-text-main) 5%, transparent);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.smart-form-close:hover {
    background: color-mix(in srgb, var(--smart-form-primary) 15%, transparent);
    transform: rotate(90deg);
}

.smart-form-close svg {
    width: 18px;
    height: 18px;
    stroke: var(--smart-form-text-muted);
    stroke-width: 2;
}

/* ============================================================================
 * Progress Bar
 * ============================================================================ */

.smart-form-progress-container {
    height: 4px;
    background: color-mix(in srgb, var(--smart-form-text-main) 5%, transparent);
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
}

.smart-form-progress-bar {
    height: 100%;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0 2px 2px 0;
}

/* ============================================================================
 * Header Section
 * ============================================================================ */

.smart-form-header {
    padding: 1.5rem 2rem 1.25rem;
    text-align: center;
    background: var(--smart-form-header-bg);
    border-bottom: 1px solid color-mix(in srgb, var(--smart-form-text-main) 10%, transparent);
}

/* Mini Logo */
.smart-form-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.smart-form-logo img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

/* Title Row with Icon */
.smart-form-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin-bottom: 0.375rem;
}

.smart-form-icon {
    width: 32px;
    height: 32px;
    background: color-mix(in srgb, var(--smart-form-primary) 10%, transparent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.smart-form-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--smart-form-primary);
    stroke-width: 2;
}

.smart-form-title {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--smart-form-text-main);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.smart-form-subtitle {
    font-size: 0.9rem;
    color: var(--smart-form-text-muted);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.smart-form-subtitle svg {
    width: 15px;
    height: 15px;
    stroke: var(--smart-form-accent);
}

/* ============================================================================
 * Form Body
 * ============================================================================ */

.smart-form-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.smart-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================================================
 * Form Fields
 * ============================================================================ */

/* ============================================================================
 * Form Fields - Floating Labels & Premium Inputs
 * ============================================================================ */

.smart-form-field {
    position: relative;
    margin-bottom: 1.5rem;
}

.smart-form-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.smart-form-input-icon {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: var(--smart-form-text-muted);
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-form-input-icon svg {
    width: 100%;
    height: 100%;
}

.smart-form-input,
.smart-form-select,
.smart-form-textarea {
    width: 100%;
    padding: 1.25rem 1rem 1.25rem 44px;
    /* Bulletproof padding for icon */
    font-size: 1rem;
    font-family: inherit;
    color: var(--smart-form-input-text);
    background: var(--smart-form-input-bg);
    border: 1px solid color-mix(in srgb, var(--smart-form-text-main) 15%, transparent);
    border-radius: var(--smart-form-radius);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    appearance: none;
}

/* Textarea needs more top padding */
.smart-form-textarea {
    min-height: 120px;
    padding-top: 1.5rem;
    resize: vertical;
}

/* Fix padding if no icon is present */
.smart-form-field:not([data-field*=" "]) .smart-form-input-wrapper:not(:has(.smart-form-input-icon)) .smart-form-input,
.smart-form-field:not([data-field*=" "]) .smart-form-input-wrapper:not(:has(.smart-form-input-icon)) .smart-form-textarea,
.smart-form-field:not([data-field*=" "]) .smart-form-input-wrapper:not(:has(.smart-form-input-icon)) .smart-form-select {
    padding-left: 1rem;
}

.smart-form-floating-label {
    position: absolute;
    left: 3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--smart-form-text-muted);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    padding: 0 4px;
    z-index: 10;
}

/* Adjust label if no icon */
.smart-form-input-wrapper:not(:has(.smart-form-input-icon)) .smart-form-floating-label {
    left: 1rem;
}

/* Floating State: Focused or Filled */
.smart-form-input:focus~.smart-form-floating-label,
.smart-form-input:not(:placeholder-shown)~.smart-form-floating-label,
.smart-form-textarea:focus~.smart-form-floating-label,
.smart-form-textarea:not(:placeholder-shown)~.smart-form-floating-label,
.smart-form-select:focus~.smart-form-floating-label,
.smart-form-select:not([value=""])~.smart-form-floating-label,
.smart-form-select:valid~.smart-form-floating-label {
    top: 0;
    font-size: 0.65rem;
    color: var(--smart-form-button-bg);
    /* Use Submit Button Color as requested */
    background: var(--smart-form-card-bg);
    transform: translateY(-50%);
    left: 1rem;
    /* Collapse to left edge regardless of icon */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    /* Round edges for backdrop */
    padding: 0 6px;
}

/* Focused State */
.smart-form-input:focus,
.smart-form-select:focus,
.smart-form-textarea:focus {
    background: var(--smart-form-card-bg);
    border-color: var(--smart-form-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--smart-form-primary) 10%, transparent);
}

.smart-form-input:focus~.smart-form-input-icon,
.smart-form-select:focus~.smart-form-input-icon,
.smart-form-textarea:focus~.smart-form-input-icon {
    color: var(--smart-form-primary);
}

/* Custom Select Arrow - adjusted for floating label */
.smart-form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ============================================================================
 * Honeypot Field (Hidden)
 * ============================================================================ */

.smart-form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ============================================================================
 * Submit Button - Flat Branded Design
 * ============================================================================ */

.smart-form-submit {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--smart-form-button-bg);
    color: var(--smart-form-button-text);
    border: none;
    border-radius: var(--smart-form-radius);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.smart-form-submit:hover {
    background: var(--smart-form-primary-hover);
    transform: translateY(-1px);
}

.smart-form-submit:active {
    transform: translateY(0);
    background: var(--smart-form-primary);
}

.smart-form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.smart-form-submit-text {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.smart-form-submit-subtext {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Loading state */
.smart-form-submit.loading .smart-form-submit-content {
    opacity: 0;
}

.smart-form-submit.loading .smart-form-spinner {
    opacity: 1;
}

.smart-form-submit-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    transition: opacity 0.2s ease;
}

.smart-form-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.smart-form-spinner svg {
    width: 24px;
    height: 24px;
    animation: smartFormSpin 1s linear infinite;
}

@keyframes smartFormSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ============================================================================
 * CRO Boosters: Timer, Scarcity & Social Proof
 * ============================================================================ */

.smart-form-cro-booster {
    margin-top: 1rem;
    display: none;
    /* Controlled by display_delay logic */
}

.sf-cro-visible .smart-form-cro-booster {
    display: block;
    animation: sfFadeInUp 0.4s ease-out;
}

@keyframes sfFadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smart-form-scarcity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem;
    background: #FFF7ED;
    border: 1px solid #FFEDD5;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #C2410C;
    font-weight: 700;
}

.smart-form-scarcity svg {
    width: 16px;
    height: 16px;
    stroke: #EA580C;
    animation: sfPulse 2s infinite;
}

@keyframes sfPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.smart-form-social-proof {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--smart-form-gray-600);
    font-weight: 500;
}

.smart-form-social-proof strong {
    color: var(--smart-form-primary);
}

.smart-form-social-dot {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    position: relative;
}

.smart-form-social-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #10B981;
    border-radius: 50%;
    animation: sfPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes sfPing {

    75%,
    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}

.smart-form-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.875rem;
    background: color-mix(in srgb, var(--smart-form-primary) 8%, white);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--smart-form-primary);
    font-weight: 600;
}

.smart-form-timer svg {
    width: 14px;
    height: 14px;
    stroke: var(--smart-form-primary);
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.smart-form-timer-text {
    font-variant-numeric: tabular-nums;
}

/* Timer urgency states */
.smart-form-timer.urgent {
    background: #FEF3C7;
    color: #D97706;
}

.smart-form-timer.urgent svg {
    stroke: #D97706;
}

.smart-form-timer.critical {
    background: #FEE2E2;
    color: #DC2626;
    animation: timerShake 0.5s ease-in-out;
}

.smart-form-timer.critical svg {
    stroke: #DC2626;
}

@keyframes timerShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-2px);
    }

    75% {
        transform: translateX(2px);
    }
}

/* ============================================================================
 * Marketing Message - Conversion Optimized
 * ============================================================================ */

.smart-form-marketing {
    text-align: center;
    margin-top: 0.875rem;
    padding: 0.75rem;
    background: color-mix(in srgb, var(--smart-form-text-main) 3%, transparent);
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--smart-form-text-main) 5%, transparent);
}

.smart-form-marketing-text {
    font-size: 0.8rem;
    color: var(--smart-form-text-muted);
    margin: 0;
    line-height: 1.5;
}

.smart-form-marketing-text strong {
    color: var(--smart-form-text-main);
    font-weight: 600;
}

.smart-form-marketing-highlight {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--smart-form-accent);
    font-weight: 600;
}

.smart-form-marketing-highlight svg {
    width: 14px;
    height: 14px;
    stroke: var(--smart-form-accent);
}

/* ============================================================================
 * Trust Badges
 * ============================================================================ */

.smart-form-trust {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.smart-form-trust-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--smart-form-text-muted);
    font-weight: 600;
}

.smart-form-trust-badge svg {
    width: 14px;
    height: 14px;
    stroke: var(--smart-form-accent);
}

/* ============================================================================
 * Success State
 * ============================================================================ */

.smart-form-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    min-height: 300px;
}

.smart-form-success.active {
    display: flex;
}

.smart-form-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--smart-form-success) 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    animation: smartFormSuccessPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes smartFormSuccessPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.smart-form-success-icon svg {
    width: 40px;
    height: 40px;
    stroke: #ffffff;
    stroke-width: 3;
    animation: smartFormCheckDraw 0.4s ease-out 0.3s both;
}

@keyframes smartFormCheckDraw {
    0% {
        stroke-dasharray: 50;
        stroke-dashoffset: 50;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

.smart-form-success-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--smart-form-text-main);
    margin: 0 0 0.5rem;
}

.smart-form-success-text {
    font-size: 1rem;
    color: var(--smart-form-text-muted);
    margin: 0;
    max-width: 280px;
}

/* Success Action Button */
.smart-form-success-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.75rem 1.5rem;
    background: var(--smart-form-primary);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.smart-form-success-action:hover {
    background: var(--smart-form-primary-hover);
    transform: translateY(-1px);
}

/* Success Extras - Quick Contact */
.smart-form-success-extras {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--smart-form-gray-100);
    width: 100%;
}

.smart-form-success-extras-label {
    font-size: 0.8rem;
    color: var(--smart-form-gray-600);
    margin: 0 0 0.75rem;
}

.smart-form-success-contacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.smart-form-success-contact {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--smart-form-gray-50);
    border: 1px solid var(--smart-form-gray-200);
    border-radius: 6px;
    color: var(--smart-form-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.smart-form-success-contact:hover {
    background: var(--smart-form-primary);
    border-color: var(--smart-form-primary);
    color: #ffffff;
}

.smart-form-success-contact svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* ============================================================================
 * Error State
 * ============================================================================ */

.smart-form-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    display: none;
}

.smart-form-error.active {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.smart-form-error svg {
    width: 20px;
    height: 20px;
    stroke: #DC2626;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.smart-form-error-text {
    font-size: 0.875rem;
    color: #991B1B;
    margin: 0;
}

/* Field validation error */
.smart-form-field.has-error .smart-form-input,
.smart-form-field.has-error .smart-form-select,
.smart-form-field.has-error .smart-form-textarea {
    border-color: #DC2626;
    background: #FEF2F2;
}

.smart-form-field-error {
    font-size: 0.75rem;
    color: #DC2626;
    margin-top: 0.375rem;
    display: none;
}

.smart-form-field.has-error .smart-form-field-error {
    display: block;
}

/* ============================================================================
 * Footer
 * ============================================================================ */

.smart-form-footer {
    padding: 1rem 2rem 1.5rem;
    background: color-mix(in srgb, var(--smart-form-text-main) 3%, transparent);
    border-top: 1px solid color-mix(in srgb, var(--smart-form-text-main) 5%, transparent);
}

.smart-form-footer-text {
    font-size: 0.75rem;
    color: var(--smart-form-text-muted);
    text-align: center;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.smart-form-footer-text svg {
    width: 14px;
    height: 14px;
    stroke: var(--smart-form-accent);
}

/* ============================================================================
 * Responsive - Mobile Optimizations
 * ============================================================================ */

@media (max-width: 480px) {
    .smart-form-modal {
        padding: 0;
        align-items: flex-end;
    }

    .smart-form-card {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--smart-form-radius) var(--smart-form-radius) 0 0;
        transform: translateY(100%);
    }

    .smart-form-modal.active .smart-form-card {
        transform: translateY(0);
    }

    .smart-form-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .smart-form-body {
        padding: 1rem 1.5rem;
    }

    .smart-form-footer {
        padding: 1rem 1.5rem 1.5rem;
        /* Account for safe area on iOS */
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
    }

    .smart-form-title {
        font-size: 1.25rem;
    }

    .smart-form-input,
    .smart-form-select,
    .smart-form-textarea {
        font-size: 16px !important;
        /* Prevents iOS auto-zoom on focus */
        padding: 0.75rem 0.875rem;
    }

    .smart-form-icon {
        width: 44px;
        height: 44px;
    }

    .smart-form-icon svg {
        width: 22px;
        height: 22px;
    }

    /* Drag handle for mobile */
    .smart-form-card::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: var(--smart-form-gray-200);
        border-radius: 2px;
        z-index: 30;
    }

    .smart-form-progress-container {
        top: 0;
        height: 4px;
    }
}

/* ============================================================================
 * Accessibility
 * ============================================================================ */

.smart-form-modal:focus {
    outline: none;
}

.smart-form-input:focus-visible,
.smart-form-select:focus-visible,
.smart-form-textarea:focus-visible,
.smart-form-submit:focus-visible,
.smart-form-close:focus-visible {
    outline: 2px solid var(--smart-form-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    .smart-form-overlay,
    .smart-form-modal,
    .smart-form-card,
    .smart-form-submit,
    .smart-form-success-icon,
    .smart-form-success-icon svg,
    .smart-form-spinner svg {
        animation: none;
        transition: none;
    }
}

/* ============================================================================
 * Dark Mode Support (if theme uses it)
 * ============================================================================ */

@media print {

    .smart-form-overlay,
    .smart-form-modal {
        display: none !important;
    }
}

.smart-form-trust-badge i {
    font-size: 14px;
    margin-right: 4px;
}

.smart-form-timer i,
.smart-form-scarcity i {
    font-size: 16px;
    margin-right: 4px;
}

.sf-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.sf-icon-wrap i {
    font-size: 14px;
}