/**
 * EBD Form Book Call Styles
 * Version: 3.2.0
 * 
 * Brand Colors:
 * - Dark Blue: #0b2663
 * - Bright Blue: #0359da
 * - Accent Green: #00cb85
 * - Teal: #0aa095
 */

/* ===== CSS VARIABLES ===== */
.ebd-form-book-call {
    /* Primary Brand Colors */
    --ebd-color-primary: #0b2663;
    --ebd-color-primary-light: #0359da;
    --ebd-color-primary-dark: #081c4a;
    --ebd-color-accent: #00cb85;
    --ebd-color-accent-hover: #0aa095;
    
    /* Status Colors */
    --ebd-color-success: #00cb85;
    --ebd-color-error: #e53e3e;
    --ebd-color-warning: #d69e2e;
    
    /* Neutrals */
    --ebd-color-bg: #f7f7f7;
    --ebd-color-surface: #ffffff;
    --ebd-color-border: #e2e8f0;
    --ebd-color-text: #1a202c;
    --ebd-color-text-muted: #718096;
    --ebd-color-text-light: #a0aec0;
    
    /* Typography */
    --ebd-font-display: 'Bebas Neue', sans-serif;
    --ebd-font-subtitle: 'Barlow', sans-serif;
    --ebd-font-body: 'Manrope', sans-serif;
    
    /* Spacing */
    --ebd-space-xs: 0.25rem;
    --ebd-space-sm: 0.5rem;
    --ebd-space-md: 1rem;
    --ebd-space-lg: 1.5rem;
    --ebd-space-xl: 2rem;
    --ebd-space-2xl: 3rem;
    
    /* Borders & Shadows */
    --ebd-radius-sm: 8px;
    --ebd-radius-md: 12px;
    --ebd-radius-lg: 16px;
    --ebd-radius-full: 50px;
    --ebd-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --ebd-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --ebd-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --ebd-shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    /* Transitions */
    --ebd-transition-fast: 150ms ease;
    --ebd-transition-normal: 250ms ease;
    --ebd-transition-slow: 400ms ease;
}

/* ===== RESET ===== */
.ebd-form-book-call,
.ebd-form-book-call *,
.ebd-form-book-call *::before,
.ebd-form-book-call *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== MAIN CONTAINER ===== */
.ebd-form-book-call {
    font-family: var(--ebd-font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ebd-color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ebd-form-book-call .ebd-form-container {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    background: var(--ebd-color-surface);
    border-radius: var(--ebd-radius-lg);
    box-shadow: var(--ebd-shadow-xl);
    overflow: hidden;
}

/* ===== PROGRESS BAR ===== */
.ebd-form-book-call .ebd-progress-container {
    padding: var(--ebd-space-lg) var(--ebd-space-xl);
    background: var(--ebd-color-surface);
    border-bottom: 1px solid var(--ebd-color-border);
}

.ebd-form-book-call .ebd-progress-bar {
    height: 4px;
    background: var(--ebd-color-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: var(--ebd-space-sm);
}

.ebd-form-book-call .ebd-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ebd-color-primary-light), var(--ebd-color-accent));
    border-radius: 2px;
    transition: width var(--ebd-transition-slow);
    width: 0%;
}

.ebd-form-book-call .ebd-progress-text {
    display: flex;
    justify-content: space-between;
    font-family: var(--ebd-font-subtitle);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ebd-color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== FORM CONTENT ===== */
.ebd-form-book-call .ebd-form-content {
    padding: var(--ebd-space-xl);
}

.ebd-form-book-call .ebd-form-step {
    display: none;
    animation: ebdFadeIn var(--ebd-transition-normal) ease;
}

.ebd-form-book-call .ebd-form-step.active {
    display: block;
}

@keyframes ebdFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ebd-form-book-call .ebd-step-title {
    font-family: var(--ebd-font-subtitle);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ebd-color-primary);
    margin: 0 0 var(--ebd-space-lg) 0;
    letter-spacing: -0.5px;
}

.ebd-form-book-call .ebd-step-subtitle {
    font-family: var(--ebd-font-body);
    color: var(--ebd-color-text-muted);
    margin-bottom: var(--ebd-space-lg);
    font-size: 0.95rem;
}

/* ===== FORM ELEMENTS ===== */
.ebd-form-book-call .ebd-form-group {
    margin-bottom: var(--ebd-space-lg);
}

.ebd-form-book-call .ebd-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ebd-space-md);
}

@media (max-width: 480px) {
    .ebd-form-book-call .ebd-form-row {
        grid-template-columns: 1fr;
    }
}

.ebd-form-book-call label {
    display: block;
    font-family: var(--ebd-font-subtitle);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ebd-color-text);
    margin-bottom: var(--ebd-space-xs);
}

.ebd-form-book-call label .required {
    color: var(--ebd-color-error);
    margin-left: 2px;
}

.ebd-form-book-call input[type="text"],
.ebd-form-book-call input[type="email"],
.ebd-form-book-call input[type="tel"],
.ebd-form-book-call input[type="url"],
.ebd-form-book-call input[type="number"],
.ebd-form-book-call select,
.ebd-form-book-call textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: var(--ebd-font-body);
    font-size: 0.95rem;
    color: var(--ebd-color-text);
    background: var(--ebd-color-surface);
    border: 1.5px solid var(--ebd-color-border);
    border-radius: var(--ebd-radius-sm);
    transition: all var(--ebd-transition-fast);
    outline: none;
}

.ebd-form-book-call input::placeholder,
.ebd-form-book-call textarea::placeholder {
    color: var(--ebd-color-text-light);
}

.ebd-form-book-call input:focus,
.ebd-form-book-call select:focus,
.ebd-form-book-call textarea:focus {
    border-color: var(--ebd-color-primary-light);
    box-shadow: 0 0 0 3px rgba(3, 89, 218, 0.1);
}

.ebd-form-book-call input.ebd-error,
.ebd-form-book-call select.ebd-error,
.ebd-form-book-call textarea.ebd-error {
    border-color: var(--ebd-color-error);
    background: #fff5f5;
}

.ebd-form-book-call input.ebd-valid {
    border-color: var(--ebd-color-success);
}

.ebd-form-book-call .ebd-error-message {
    font-family: var(--ebd-font-body);
    font-size: 0.8rem;
    color: var(--ebd-color-error);
    margin-top: var(--ebd-space-xs);
    display: none;
}

.ebd-form-book-call .ebd-error-message.show {
    display: block;
}

/* Warning message (for risky but allowed emails) */
.ebd-form-book-call .ebd-warning-message {
    font-family: var(--ebd-font-body);
    font-size: 0.8rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid var(--ebd-color-warning);
    border-radius: var(--ebd-radius-sm);
    padding: var(--ebd-space-sm) var(--ebd-space-md);
    margin-top: var(--ebd-space-xs);
    display: none;
}

.ebd-form-book-call .ebd-warning-message.show {
    display: block;
}

.ebd-form-book-call .ebd-helper-text {
    font-size: 0.8rem;
    color: var(--ebd-color-text-muted);
    margin-top: var(--ebd-space-xs);
}

/* ===== PHONE INPUT WITH COUNTRY CODE ===== */
.ebd-form-book-call .ebd-phone-input-group {
    display: flex;
    gap: 0;
}

.ebd-form-book-call .ebd-phone-country-select {
    width: 110px;
    flex-shrink: 0;
    border-radius: var(--ebd-radius-sm) 0 0 var(--ebd-radius-sm);
    border-right: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.ebd-form-book-call .ebd-phone-country-select:focus {
    z-index: 1;
}

.ebd-form-book-call .ebd-phone-input-group input[type="tel"] {
    flex: 1;
    border-radius: 0 var(--ebd-radius-sm) var(--ebd-radius-sm) 0;
    border-left: none;
}

.ebd-form-book-call .ebd-phone-input-group input[type="tel"]:focus {
    border-left: 1.5px solid var(--ebd-color-primary-light);
}

.ebd-form-book-call .ebd-phone-input-group.ebd-error .ebd-phone-country-select,
.ebd-form-book-call .ebd-phone-input-group.ebd-error input[type="tel"] {
    border-color: var(--ebd-color-error);
    background-color: #fff5f5;
}

/* ===== OPTION CARDS ===== */
.ebd-form-book-call .ebd-option-group {
    display: flex;
    flex-direction: column;
    gap: var(--ebd-space-sm);
}

.ebd-form-book-call .ebd-option-card {
    position: relative;
    padding: var(--ebd-space-md) var(--ebd-space-lg);
    background: var(--ebd-color-surface);
    border: 1.5px solid var(--ebd-color-border);
    border-radius: var(--ebd-radius-sm);
    cursor: pointer;
    transition: all var(--ebd-transition-fast);
}

.ebd-form-book-call .ebd-option-card:hover {
    border-color: var(--ebd-color-primary-light);
    background: #f8fafc;
}

.ebd-form-book-call .ebd-option-card.selected {
    border-color: var(--ebd-color-primary-light);
    background: rgba(3, 89, 218, 0.04);
}

.ebd-form-book-call .ebd-option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ebd-form-book-call .ebd-option-content {
    display: flex;
    align-items: center;
    gap: var(--ebd-space-md);
}

.ebd-form-book-call .ebd-option-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid var(--ebd-color-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--ebd-transition-fast);
}

.ebd-form-book-call .ebd-option-card.checkbox-card .ebd-option-indicator {
    border-radius: 4px;
}

.ebd-form-book-call .ebd-option-card.selected .ebd-option-indicator {
    border-color: var(--ebd-color-primary-light);
    background: var(--ebd-color-primary-light);
}

.ebd-form-book-call .ebd-option-card.selected .ebd-option-indicator::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.ebd-form-book-call .ebd-option-card.checkbox-card.selected .ebd-option-indicator::after {
    width: 10px;
    height: 10px;
    background: transparent;
    border-radius: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: contain;
}

.ebd-form-book-call .ebd-option-text {
    font-family: var(--ebd-font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ebd-color-text);
}

.ebd-form-book-call .ebd-option-description {
    font-size: 0.8rem;
    color: var(--ebd-color-text-muted);
    margin-top: 2px;
}

/* ===== CONDITIONAL MESSAGES ===== */
.ebd-form-book-call .ebd-conditional-message {
    margin-top: var(--ebd-space-md);
    padding: var(--ebd-space-md);
    background: #fffbeb;
    border: 1px solid var(--ebd-color-warning);
    border-radius: var(--ebd-radius-sm);
    font-size: 0.875rem;
    color: #92400e;
    display: none;
}

.ebd-form-book-call .ebd-conditional-message.show {
    display: block;
    animation: ebdFadeIn var(--ebd-transition-fast) ease;
}

.ebd-form-book-call .ebd-conditional-message.ebd-unavailable {
    background: #fed7d7;
    border-color: var(--ebd-color-error);
    color: #c53030;
}

/* ===== HIDDEN CONDITIONAL FIELD ===== */
.ebd-form-book-call .ebd-conditional-field {
    display: none;
    margin-top: var(--ebd-space-md);
    animation: ebdFadeIn var(--ebd-transition-fast) ease;
}

.ebd-form-book-call .ebd-conditional-field.show {
    display: block;
}

/* ===== BUTTONS ===== */
.ebd-form-book-call .ebd-button-group {
    display: flex;
    gap: var(--ebd-space-md);
    margin-top: var(--ebd-space-xl);
}

.ebd-form-book-call .ebd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ebd-space-sm);
    padding: 0.875rem 1.75rem;
    font-family: var(--ebd-font-subtitle);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--ebd-radius-full);
    cursor: pointer;
    transition: all var(--ebd-transition-fast);
    text-decoration: none;
}

.ebd-form-book-call .ebd-btn-primary {
    background: var(--ebd-color-primary);
    color: white;
    flex: 1;
}

.ebd-form-book-call .ebd-btn-primary:hover {
    background: var(--ebd-color-primary-light);
    transform: translateY(-1px);
    box-shadow: var(--ebd-shadow-md);
}

.ebd-form-book-call .ebd-btn-secondary {
    background: transparent;
    color: var(--ebd-color-primary-light);
    border: 1.5px solid var(--ebd-color-primary-light);
}

.ebd-form-book-call .ebd-btn-secondary:hover {
    background: rgba(3, 89, 218, 0.05);
    color: var(--ebd-color-primary);
    border-color: var(--ebd-color-primary);
}

.ebd-form-book-call .ebd-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ebd-form-book-call .ebd-btn .ebd-icon {
    width: 18px;
    height: 18px;
}

/* ===== CALENDLY CONTAINER ===== */
.ebd-form-book-call .ebd-calendly-intro {
    text-align: center;
    margin-bottom: var(--ebd-space-lg);
    font-family: var(--ebd-font-body);
    color: var(--ebd-color-text-muted);
    font-size: 0.95rem;
}

.ebd-form-book-call .ebd-calendly-container {
    min-height: 700px;
    border-radius: var(--ebd-radius-md);
    overflow: hidden;
    background: var(--ebd-color-bg);
}

.ebd-form-book-call .ebd-calendly-container iframe {
    border: none;
}

/* ===== LOADING OVERLAY ===== */
.ebd-form-book-call .ebd-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--ebd-transition-normal);
}

.ebd-form-book-call .ebd-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ebd-form-book-call .ebd-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ebd-color-border);
    border-top-color: var(--ebd-color-primary-light);
    border-radius: 50%;
    animation: ebdSpin 1s linear infinite;
}

.ebd-form-book-call .ebd-loading-text {
    margin-top: var(--ebd-space-md);
    font-family: var(--ebd-font-body);
    color: var(--ebd-color-text-muted);
    font-size: 0.9rem;
}

@keyframes ebdSpin {
    to { transform: rotate(360deg); }
}

/* ===== RETURNING USER NOTICE ===== */
.ebd-form-book-call .ebd-returning-user-notice {
    padding: var(--ebd-space-lg);
    background: linear-gradient(135deg, rgba(3, 89, 218, 0.05) 0%, rgba(0, 203, 133, 0.05) 100%);
    border: 1px solid var(--ebd-color-accent);
    border-radius: var(--ebd-radius-md);
    margin-bottom: var(--ebd-space-xl);
    display: none;
}

.ebd-form-book-call .ebd-returning-user-notice h3 {
    font-family: var(--ebd-font-subtitle);
    font-weight: 600;
    color: var(--ebd-color-primary);
    margin: 0 0 var(--ebd-space-sm) 0;
}

.ebd-form-book-call .ebd-returning-user-notice p {
    font-family: var(--ebd-font-body);
    color: var(--ebd-color-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.ebd-form-book-call .ebd-user-email {
    font-weight: 600;
    color: var(--ebd-color-primary);
}

/* ===== MODAL ===== */
.ebd-form-book-call .ebd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 38, 99, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--ebd-transition-normal);
    padding: var(--ebd-space-xl);
}

.ebd-form-book-call .ebd-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ebd-form-book-call .ebd-modal-content {
    background: white;
    border-radius: var(--ebd-radius-lg);
    max-width: 480px;
    width: 100%;
    padding: var(--ebd-space-2xl);
    text-align: center;
    transform: scale(0.9);
    transition: all var(--ebd-transition-normal);
}

.ebd-form-book-call .ebd-modal-overlay.show .ebd-modal-content {
    transform: scale(1);
}

.ebd-form-book-call .ebd-modal-content h2 {
    font-family: var(--ebd-font-subtitle);
    font-weight: 700;
    color: var(--ebd-color-primary);
    margin: 0 0 var(--ebd-space-md) 0;
}

.ebd-form-book-call .ebd-modal-content p {
    font-family: var(--ebd-font-body);
    color: var(--ebd-color-text-muted);
    margin: 0 0 var(--ebd-space-xl) 0;
}

/* ===== SUCCESS STATE ===== */
.ebd-form-book-call .ebd-success-state {
    text-align: center;
    padding: var(--ebd-space-2xl);
}

.ebd-form-book-call .ebd-success-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--ebd-color-accent), var(--ebd-color-accent-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--ebd-space-xl);
    animation: ebdSuccessPop 0.5s ease;
}

@keyframes ebdSuccessPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.ebd-form-book-call .ebd-success-icon svg {
    width: 36px;
    height: 36px;
    color: white;
    stroke: white;
}

.ebd-form-book-call .ebd-success-state h2 {
    font-family: var(--ebd-font-subtitle);
    font-weight: 700;
    color: var(--ebd-color-primary);
    margin: 0 0 var(--ebd-space-md) 0;
}

.ebd-form-book-call .ebd-success-state p {
    font-family: var(--ebd-font-body);
    color: var(--ebd-color-text-muted);
    margin: 0;
}

/* ===== FOOTER ===== */
.ebd-form-book-call .ebd-form-footer {
    padding: var(--ebd-space-md) var(--ebd-space-xl);
    background: var(--ebd-color-bg);
    border-top: 1px solid var(--ebd-color-border);
    text-align: center;
    font-family: var(--ebd-font-body);
    font-size: 0.75rem;
    color: var(--ebd-color-text-muted);
}

.ebd-form-book-call .ebd-form-footer a {
    color: var(--ebd-color-primary-light);
    text-decoration: none;
}

.ebd-form-book-call .ebd-form-footer a:hover {
    text-decoration: underline;
}
