/**
 * Splace BPO Client Intake Form Styles
 * Version: 1.1.1 - Matching Reference Design
 */

/* ================================
   CSS Variables
   ================================ */
:root {
    --splace-primary: #ff004d;
    --splace-primary-dark: #cc003d;
    --splace-primary-light: #fff0f3;
    --splace-success: #16a34a;
    --splace-error: #ef4444;
    --splace-slate-50: #f8fafc;
    --splace-slate-100: #f1f5f9;
    --splace-slate-200: #e2e8f0;
    --splace-slate-300: #cbd5e1;
    --splace-slate-400: #94a3b8;
    --splace-slate-500: #64748b;
    --splace-slate-600: #475569;
    --splace-slate-700: #334155;
    --splace-slate-800: #1e293b;
    --splace-white: #ffffff;
}

/* ================================
   Base Reset for Container
   ================================ */
.splace-form-container,
.splace-form-container *,
.splace-form-container *::before,
.splace-form-container *::after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

.splace-form-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.6 !important;
    color: #334155 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: transparent !important;
}

.splace-form-wrapper {
    padding-bottom: 3rem;
    background: transparent !important;
}

/* ================================
   Header / Hero Section
   ================================ */
.splace-header {
    background: linear-gradient(135deg, #ff004d 0%, #cc003d 100%) !important;
    min-height: 16rem !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: hidden !important;
    padding: 2rem 1rem !important;
}

.splace-header-pattern {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0.1 !important;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><rect width="40" height="40" fill="none"/><rect x="0" y="0" width="20" height="20" fill="white" opacity="0.1"/><rect x="20" y="20" width="20" height="20" fill="white" opacity="0.1"/></svg>') !important;
}

.splace-header-content {
    position: relative !important;
    z-index: 10 !important;
    text-align: center !important;
}

.splace-header-title {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    letter-spacing: -0.02em !important;
    margin: 0 0 0.5rem 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
}

.splace-header-subtitle {
    font-size: 1.125rem !important;
    font-weight: 300 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 !important;
    display: block !important;
}

@media (min-width: 768px) {
    .splace-header-title {
        font-size: 3rem !important;
    }
    .splace-header-subtitle {
        font-size: 1.25rem !important;
    }
}

/* ================================
   Form Card
   ================================ */
.splace-form-card {
    max-width: 56rem !important;
    margin: -4rem auto 0 !important;
    padding: 0 1rem !important;
    position: relative !important;
    z-index: 20 !important;
}

.splace-form-card-no-header {
    margin-top: 1.5rem !important;
}

/* Unified card wrapper */
.splace-card-inner {
    background: #ffffff !important;
    border-radius: 1rem !important;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
    overflow: hidden !important;
}

.splace-card-inner > .splace-progress-section,
.splace-card-inner > .splace-form {
    background: #ffffff !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.splace-card-inner > .splace-progress-section {
    padding: 2rem 2rem 1.5rem !important;
    margin: 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.splace-card-inner > .splace-form {
    padding: 1.5rem 2rem 2rem !important;
    margin: 0 !important;
}

/* Fallback for direct children (backwards compatibility) */
.splace-form-card > .splace-progress-section,
.splace-form-card > .splace-form {
    background: #ffffff !important;
}

.splace-form-card > .splace-progress-section {
    border-radius: 1rem 1rem 0 0 !important;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
    padding: 2rem 2rem 1.5rem !important;
    margin-bottom: 0 !important;
}

.splace-form-card > .splace-form {
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
    border-radius: 0 0 1rem 1rem !important;
    padding: 1.5rem 2rem 2rem !important;
    margin-top: 0 !important;
}

/* ================================
   Step Indicator with Progress Line
   ================================ */
.splace-step-indicator {
    margin-bottom: 2rem !important;
}

.splace-step-container {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    position: relative !important;
}

/* Background line */
.splace-step-line-bg {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 1.25rem !important;
    height: 4px !important;
    background: #e2e8f0 !important;
    z-index: 0 !important;
    border-radius: 2px !important;
    display: block !important;
    transform: translateY(-50%) !important;
}

/* Progress line */
.splace-step-line-progress {
    position: absolute !important;
    left: 0 !important;
    top: 1.25rem !important;
    height: 4px !important;
    background: #ff004d !important;
    z-index: 1 !important;
    border-radius: 2px !important;
    transition: width 0.5s ease-in-out !important;
    display: block !important;
    transform: translateY(-50%) !important;
}

.splace-step-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    position: relative !important;
    z-index: 2 !important;
    flex: 1 !important;
}

.splace-step-circle {
    width: 2.5rem !important;
    height: 2.5rem !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    border: 2px solid #cbd5e1 !important;
    color: #94a3b8 !important;
    transition: all 0.3s ease !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
}

.splace-step-circle.splace-step-active {
    border-color: #ff004d !important;
    color: #ff004d !important;
}

.splace-step-circle.splace-step-completed {
    background: #ff004d !important;
    border-color: #ff004d !important;
    color: #ffffff !important;
}

.splace-step-number {
    font-weight: 600 !important;
    font-size: 0.875rem !important;
}

.splace-step-label {
    margin-top: 0.5rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #64748b !important;
    text-align: center !important;
}

.splace-step-label-active {
    color: #ff004d !important;
}

/* ================================
   Section Headers
   ================================ */
.splace-section-header {
    border-bottom: 1px solid #f1f5f9 !important;
    padding-bottom: 1rem !important;
    margin-bottom: 1.5rem !important;
}

.splace-section-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin: 0 0 0.25rem 0 !important;
    line-height: 1.3 !important;
}

.splace-section-icon {
    color: #ff004d !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    flex-shrink: 0 !important;
}

.splace-section-desc {
    color: #64748b !important;
    margin: 0.25rem 0 0 0 !important;
    font-size: 0.9375rem !important;
    line-height: 1.5 !important;
}

/* ================================
   Form Fields
   ================================ */
.splace-form-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
}

@media (min-width: 768px) {
    .splace-form-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

.splace-form-full {
    grid-column: 1 / -1 !important;
}

.splace-form-field {
    margin-bottom: 1rem !important;
}

.splace-form-label {
    display: block !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #334155 !important;
    margin-bottom: 0.25rem !important;
}

.splace-required {
    color: #ef4444 !important;
    margin-left: 0.125rem !important;
}

.splace-input-wrapper {
    position: relative !important;
}

.splace-input-icon {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 2.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #94a3b8 !important;
    pointer-events: none !important;
}

.splace-input,
.splace-textarea,
.splace-select {
    width: 100% !important;
    padding: 0.625rem 0.75rem !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.5rem !important;
    font-size: 0.9375rem !important;
    font-family: inherit !important;
    color: #334155 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
}

.splace-input:hover,
.splace-textarea:hover,
.splace-select:hover {
    border-color: #94a3b8 !important;
}

.splace-input:focus,
.splace-textarea:focus,
.splace-select:focus {
    outline: none !important;
    border-color: #ff004d !important;
    box-shadow: 0 0 0 3px rgba(255, 0, 77, 0.15) !important;
}

.splace-input::placeholder,
.splace-textarea::placeholder {
    color: #94a3b8 !important;
}

.splace-input-with-icon {
    padding-left: 2.5rem !important;
}

.splace-textarea {
    resize: vertical !important;
    min-height: 80px !important;
}

/* Select Field */
.splace-select-wrapper {
    position: relative !important;
}

.splace-select {
    appearance: none !important;
    padding-right: 2.5rem !important;
    cursor: pointer !important;
}

.splace-select-arrow {
    position: absolute !important;
    right: 0.75rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    color: #94a3b8 !important;
}

/* ================================
   Radio & Checkbox
   ================================ */
.splace-bpo-question {
    background: #f8fafc !important;
    padding: 1.5rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid #f1f5f9 !important;
    margin-bottom: 1.5rem !important;
}

.splace-radio-group {
    display: flex !important;
    gap: 1.5rem !important;
    margin-top: 0.75rem !important;
}

.splace-radio-item {
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
}

.splace-radio {
    width: 1rem !important;
    height: 1rem !important;
    margin-right: 0.5rem !important;
    accent-color: #ff004d !important;
}

.splace-checkbox-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
}

@media (min-width: 480px) {
    .splace-checkbox-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.splace-checkbox-item {
    display: flex !important;
    align-items: center !important;
    padding: 0.75rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.5rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    background: #ffffff !important;
}

.splace-checkbox-item:hover {
    background: #f8fafc !important;
}

.splace-checkbox-item.splace-checkbox-checked {
    background: #fff0f3 !important;
    border-color: #ff004d !important;
    box-shadow: 0 0 0 1px #ff004d !important;
}

.splace-checkbox {
    width: 1rem !important;
    height: 1rem !important;
    margin-right: 0.5rem !important;
    accent-color: #ff004d !important;
}

.splace-checkbox-label {
    font-size: 0.875rem !important;
    color: #334155 !important;
}

/* ================================
   Section Divider
   ================================ */
.splace-section-divider {
    margin-top: 1.5rem !important;
    padding-top: 1.5rem !important;
    border-top: 1px solid #f1f5f9 !important;
}

/* ================================
   Error Message
   ================================ */
.splace-error {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #ef4444 !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem !important;
    margin-bottom: 1rem !important;
    font-size: 0.875rem !important;
}

/* ================================
   Navigation Buttons
   ================================ */
.splace-nav-buttons {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 2.5rem !important;
    padding-top: 1.5rem !important;
    border-top: 1px solid #e2e8f0 !important;
}

.splace-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 0.625rem 1.5rem !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    border-radius: 0.5rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: none !important;
}

.splace-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.splace-btn-primary {
    background: #ff004d !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(255, 0, 77, 0.3), 0 2px 4px -2px rgba(255, 0, 77, 0.2) !important;
}

.splace-btn-primary:hover:not(:disabled) {
    background: #cc003d !important;
    transform: translateY(-1px) !important;
}

.splace-btn-secondary {
    background: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

.splace-btn-secondary:hover:not(:disabled) {
    background: #f8fafc !important;
}

.splace-btn-success {
    background: #16a34a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(22, 163, 74, 0.3), 0 2px 4px -2px rgba(22, 163, 74, 0.2) !important;
}

.splace-btn-success:hover:not(:disabled) {
    background: #15803d !important;
    transform: translateY(-1px) !important;
}

/* ================================
   Footer
   ================================ */
.splace-footer {
    text-align: center !important;
    color: #64748b !important;
    font-size: 0.875rem !important;
    margin-top: 2rem !important;
    padding: 0 1rem !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.splace-footer p {
    margin: 0 0 0.5rem 0 !important;
}

.splace-footer-contact {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1rem !important;
    margin-top: 0.5rem !important;
}

.splace-footer-contact span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
}

/* ================================
   Modal
   ================================ */
.splace-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.5) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    backdrop-filter: blur(4px) !important;
    padding: 1rem !important;
}

.splace-modal {
    background: #ffffff !important;
    border-radius: 1rem !important;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25) !important;
    max-width: 28rem !important;
    width: 100% !important;
    padding: 2rem !important;
    text-align: center !important;
    animation: splace-modal-in 0.3s ease !important;
}

@keyframes splace-modal-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.splace-modal-icon {
    width: 5rem !important;
    height: 5rem !important;
    background: #dcfce7 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 1.5rem !important;
    color: #16a34a !important;
}

.splace-modal-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin: 0 0 0.5rem 0 !important;
}

.splace-modal-message {
    color: #475569 !important;
    margin: 0 0 2rem 0 !important;
    line-height: 1.6 !important;
}

/* ================================
   Icons
   ================================ */
.splace-icon-xs {
    width: 1rem !important;
    height: 1rem !important;
}

.splace-icon-sm {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

.splace-icon-lg {
    width: 2.5rem !important;
    height: 2.5rem !important;
}

.splace-spinner {
    animation: splace-spin 1s linear infinite !important;
}

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

/* ================================
   Animation
   ================================ */
.splace-step-content {
    animation: splace-fade-in 0.3s ease !important;
}

@keyframes splace-fade-in {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ================================
   Responsive Adjustments
   ================================ */
@media (max-width: 640px) {
    .splace-header {
        min-height: 14rem !important;
    }
    
    .splace-header-title {
        font-size: 2rem !important;
    }
    
    .splace-form-card {
        margin-top: -3rem !important;
    }
    
    .splace-form-card > .splace-progress-section,
    .splace-form-card > .splace-form {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .splace-step-label {
        font-size: 0.625rem !important;
    }
    
    .splace-section-title {
        font-size: 1.25rem !important;
    }
    
    .splace-nav-buttons {
        flex-direction: column-reverse !important;
        gap: 0.75rem !important;
    }
    
    .splace-nav-buttons .splace-btn {
        width: 100% !important;
    }
}

/* ================================
   Loading State
   ================================ */
.splace-form-loading {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4rem 2rem !important;
    color: #64748b !important;
}

.splace-form-spinner {
    width: 40px !important;
    height: 40px !important;
    border: 3px solid #e2e8f0 !important;
    border-top-color: #ff004d !important;
    border-radius: 50% !important;
    animation: splace-spin 0.8s linear infinite !important;
    margin-bottom: 1rem !important;
}

/* ================================
   Elementor Popup Adjustments
   ================================ */
.elementor-popup-modal .splace-form-container {
    max-height: 90vh !important;
    overflow-y: auto !important;
}

.elementor-popup-modal .splace-header {
    min-height: auto !important;
    padding: 2rem 1rem !important;
}

.elementor-popup-modal .splace-form-card {
    margin-top: 0 !important;
    padding: 0 !important;
}

/* ================================
   Print Styles
   ================================ */
@media print {
    .splace-nav-buttons,
    .splace-footer {
        display: none !important;
    }
}
