/* Form container styles */
:root {
    --orgreach-primary: #823dd8;
    --orgreach-primary-dark: #6f2bb0;
    --orgreach-primary-light: #a26cf5;
    --orgreach-secondary: #5b616b;
    --orgreach-neutral: #e2e8f0;
    --orgreach-background-light: #f8f9fb;
    --orgreach-card-light: #f1f5f9;
    --orgreach-danger: #ef4444;
    --orgreach-success: #22c55e;
    --white: #ffffff;
    
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    
    --radius: 0.5rem;
    --transition-base: 0.2s ease-in-out;
}

.orgreach-onboarding-widget,
.orgreach-tenant-onboarding {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    overflow: hidden;
}

/* Header styles */
.widget-header {
    background: #823dd8;
    padding: var(--space-6);
    text-align: center;
    color: var(--white);
}

.widget-header .logo {
    width: 180px;
    height: auto;
    margin-bottom: var(--space-6);
}

.widget-header .title {
    color: var(--white);
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 var(--space-4);
    line-height: 1.2;
}

.widget-header .tagline {
    font-size: 1.125rem;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}

/* Step heading styles */
.step-heading {
    margin-bottom: var(--space-4);
    width: 100%;
    font-size: 1.5em;
    line-height: 1.4;
    color: var(--orgreach-primary);
    font-weight: 600;
}

.step-heading p {
    margin: 0;
}

.step-heading h1, .step-heading h2, .step-heading h3, 
.step-heading h4, .step-heading h5, .step-heading h6 {
    margin: 0;
    line-height: inherit;
}

/* Form group styles */
.form-group {
    margin-bottom: var(--space-6);
    width: 100%;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.phone-input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    background: var(--white);
    border: 2px solid var(--orgreach-neutral);
    border-radius: var(--radius);
    transition: all var(--transition-base);
}

.phone-input-group:focus-within {
    border-color: var(--orgreach-primary);
    box-shadow: 0 0 0 3px var(--orgreach-primary-light);
}

.country-code-select {
    flex: 0 0 auto;
    padding: 0 var(--space-2);
    border: none;
    border-right: 2px solid var(--orgreach-neutral);
    background-color: var(--orgreach-background-light);
    font-size: var(--font-size-base);
    font-family: inherit;
    cursor: pointer;
    min-width: 90px;
}

.country-code-select:focus {
    outline: none;
}

.phone-number-input {
    flex: 1 1 auto;
    padding: var(--space-3) var(--space-4);
    border: none;
    font-size: var(--font-size-base);
    font-family: inherit;
    min-height: 44px;
    box-sizing: border-box;
    width: 100%;
}

.phone-number-input:focus {
    outline: none;
}

/* Tooltip styling */
.phone-number-input[title] {
    cursor: help;
}

/* Hide default tooltip and use custom one */
.phone-number-input:hover::before {
    content: attr(title);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
}

.form-control:focus {
    border-color: var(--orgreach-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--orgreach-primary-light);
}

.form-control.error {
    border-color: var(--orgreach-danger);
}

.form-control.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.form-control.valid {
    border-color: var(--orgreach-success);
}

.form-control.valid:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* Phone input styling */
.iti {
    width: 100% !important;
    display: block !important;
    margin-bottom: var(--space-4);
}

/* Force country code dropdown to be visible */
.iti__selected-flag {
    padding: 0 12px !important;
    background-color: var(--orgreach-background-light) !important;
}

.iti__country-list {
    max-height: 200px;
    overflow-y: auto;
    border-radius: var(--radius);
}

/* Ensure the flag and country code are visible */
.iti--separate-dial-code .iti__selected-dial-code {
    color: var(--orgreach-secondary);
    font-weight: 500;
}

.iti__flag {
    background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.13/img/flags.png");
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .iti__flag {
        background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.13/img/flags@2x.png");
    }
}

.iti__selected-flag {
    background-color: var(--orgreach-background-light) !important;
    border-right: 1px solid var(--orgreach-neutral) !important;
}

.iti--separate-dial-code .iti__selected-flag {
    background-color: var(--orgreach-background-light) !important;
    border-right: 1px solid var(--orgreach-neutral) !important;
    padding-left: 15px !important;
}

.iti__country-list {
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    border-color: var(--orgreach-neutral) !important;
}

.iti input {
    padding-left: 85px !important;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: var(--font-size-base);
    font-weight: 700;
    min-height: 48px;
    cursor: pointer;
    transition: all var(--transition-base);
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.btn-primary {
    background-color: var(--orgreach-primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--orgreach-primary-dark);
}

.sms-disclosure {
    margin: var(--space-4) 0;
    padding: var(--space-4);
    background: var(--orgreach-card-light);
    border-radius: var(--radius);
    color: var(--orgreach-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

.sms-disclosure p {
    margin: 0;
    line-height: inherit;
}

.sms-disclosure a {
    color: var(--orgreach-primary);
    text-decoration: none;
}

.sms-disclosure a:hover {
    text-decoration: underline;
}

/* Steps container */
.progress-steps {
    display: flex;
    justify-content: space-between;
    padding: var(--space-6) var(--space-4);
    background: var(--white);
    border-bottom: 1px solid var(--orgreach-neutral);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background: var(--orgreach-neutral);
    z-index: 1;
}

.progress-step.active:not(:last-child)::after {
    background: var(--orgreach-primary);
}

.step-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--orgreach-neutral);
    color: var(--orgreach-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: var(--space-2);
    position: relative;
    z-index: 2;
    transition: all var(--transition-base);
}

.progress-step.active .step-indicator {
    background: var(--orgreach-primary);
    color: var(--white);
}

.progress-step.completed .step-indicator {
    background: var(--orgreach-success);
    color: var(--white);
}

.step-label {
    font-size: var(--font-size-sm);
    color: var(--orgreach-secondary);
    text-align: center;
    transition: all var(--transition-base);
}

.progress-step.active .step-label {
    color: var(--orgreach-primary);
    font-weight: 500;
}

.onboarding-steps {
    padding: var(--space-6);
    min-height: 400px; /* Consistent form height */
}

/* Verification step styling */
.verification-step {
    text-align: center;
}

.verification-message {
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    background: var(--orgreach-background-light);
    border-radius: var(--radius);
}

.sent-to-message {
    margin: 0;
    color: var(--orgreach-secondary);
    font-size: var(--font-size-base);
}

.phone-display {
    color: var(--orgreach-primary);
    font-weight: 600;
}

.verification-input {
    text-align: center;
    letter-spacing: 0.25em;
    font-size: 1.5em;
    padding: var(--space-4);
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    border: 2px solid var(--orgreach-neutral);
    border-radius: var(--radius);
    transition: all var(--transition-base);
}

.verification-input:focus {
    border-color: var(--orgreach-primary);
    box-shadow: 0 0 0 3px var(--orgreach-primary-light);
    outline: none;
}

.verification-help {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.resend-code,
.change-number {
    background: none;
    border: none;
    color: var(--orgreach-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.resend-code:hover,
.change-number:hover {
    color: var(--orgreach-primary-dark);
}

/* Responsive styles */
@media (max-width: 768px) {
    .widget-header {
        padding: var(--space-4);
    }

    .widget-header .logo {
        width: 140px;
        margin-bottom: var(--space-4);
    }

    .widget-header .title {
        font-size: 1.5rem;
        margin-bottom: var(--space-3);
    }

    .widget-header .tagline {
        font-size: 1rem;
    }

    .onboarding-steps {
        padding: var(--space-4);
    }

    .step-heading {
        font-size: 1.25em;
    }
}

/* Editor styles */
.elementor-control-phone_step_label .elementor-control-content .elementor-control-tag-area {
    min-height: 100px;
}