/**
 * ACME Forms Stripe - Form Styles
 * Minimal styles for phone field integration.
 */

/* Phone field container - ensure full width */
.acme-field-phone_international .iti {
    display: block;
    width: 100%;
}

.acme-field-phone_international .iti__tel-input {
    width: 100%;
}

/* Ensure flag container is visible */
.acme-field-phone_international .iti__flag-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    padding: 0;
}

/* Ensure dropdown is above other elements */
.iti__dropdown-content {
    z-index: 100000 !important;
}

.iti--container {
    z-index: 100000 !important;
}

/* Country dropdown styling */
.iti .iti__dropdown-content {
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid #e8e8e8 !important;
    overflow: hidden !important;
}

.iti .iti__dropdown-content .iti__search-input-wrapper {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    padding: 10px 12px !important;
    background: #fafafa !important;
    border-bottom: 1px solid #eee !important;
}

.iti .iti__dropdown-content .iti__search-input {
    box-sizing: border-box !important;
    width: 100% !important;
    padding: 10px 32px 10px 36px !important;
    border: 1.5px solid #ddd !important;
    border-radius: 8px !important;
    outline: none !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    background: #fff !important;
    transition: border-color 0.2s ease !important;
}

.iti .iti__dropdown-content .iti__search-input::placeholder {
    color: #aaa !important;
}

.iti .iti__dropdown-content .iti__search-input:focus {
    border-color: #094345 !important;
    box-shadow: 0 0 0 3px rgba(9, 67, 69, 0.08) !important;
}

.iti .iti__dropdown-content .iti__search-icon {
    position: absolute !important;
    left: 22px !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    pointer-events: none !important;
    opacity: 0.4 !important;
}

.iti .iti__search-clear{
    right: 15px !important;
    transform: translateY(-50%) !important;
}

.iti--allow-dropdown .iti__country-container:not(:has(+ input[disabled])):not(:has(+ input[readonly])) .iti__selected-country-primary:hover, .iti--allow-dropdown .iti__country-container:not(:has(+ input[disabled])):not(:has(+ input[readonly])) .iti__selected-country:has(+ .iti__dropdown-content:hover) .iti__selected-country-primary{
    background: initial;
}

.iti .iti__dropdown-content .iti__country-list {
    max-height: 220px !important;
    padding: 4px 0 !important;
}

.iti .iti__dropdown-content .iti__country {
    padding: 8px 12px !important;
    transition: background-color 0.15s ease !important;
}

.iti .iti__dropdown-content .iti__country:hover,
.iti .iti__dropdown-content .iti__country--highlight {
    background-color: rgba(9, 67, 69, 0.06) !important;
}


/* Form error/success message */
.acme-form-message {
    margin-top: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

/* Required marker */
.acme-required {
    color: #dc3545;
}

/* Validation error state */
.acme-phone-input.acme-invalid {
    border-color: #dc3545 !important;
}

.acme-phone-input.acme-valid {
    border-color: #28a745 !important;
}

/* Fix for Elementor compatibility */
.elementor-widget-acme_forms_stripe .iti {
    display: block;
}

/* File upload button */
.acme-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.acme-file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: #4fb5a9;
    color: #fff;
    border-radius: 100px;
    padding: 10px 10px 10px 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
}

.acme-file-upload-btn:hover {
    background-color: #3d9e93;
}

.acme-file-upload-icon-left {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.acme-file-upload-icon-left svg {
    width: 22px;
    height: 22px;
}

.acme-file-upload-text {
    flex: 1;
    white-space: nowrap;
}

.acme-file-upload-icon-right {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #fff;
    color: #4fb5a9;
    border-radius: 50%;
    flex-shrink: 0;
}

.acme-file-upload-icon-right svg {
    width: 18px;
    height: 18px;
}

/* File upload layout */
.acme-file-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acme-file-upload-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* View files button (next to upload button) */
.acme-file-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #34495e;
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.acme-file-view-btn:hover {
    background-color: #2c3e50;
}

.acme-file-view-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.acme-file-view-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #34495e;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* File modal */
.acme-file-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
}

.acme-file-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.acme-file-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    z-index: 1;
}

.acme-file-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.acme-file-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.acme-file-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.acme-file-modal-close:hover {
    color: #000;
}

/* File list */
.acme-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acme-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
}

.acme-file-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.acme-file-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 12px;
}

.acme-file-item-view,
.acme-file-item-remove {
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1.4;
}

.acme-file-item-view {
    background: #4fb5a9;
    color: #fff;
}

.acme-file-item-view:hover {
    background: #3d9e93;
}

.acme-file-item-remove {
    background: #e74c3c;
    color: #fff;
}

.acme-file-item-remove:hover {
    background: #c0392b;
}

.acme-form input,
.acme-form textarea
{
    background: #f7f7f7 !important;
}

.acme-form textarea{
    border: 1px solid #d0d0d0;
}

.acme-field{
    padding: 0;
}

p.acme-field{
    margin: 0;
}

label.acme-choice-option{
    margin: 0;
}

/* Standalone checkbox (single checkbox fields) */
.acme-form input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid #c0c0c0;
    border-radius: 4px;
    background: #fff !important;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin: 0 6px 0 0;
}

.acme-form input[type="checkbox"]:checked {
    background: #4fb5a9 !important;
    border-color: #4fb5a9;
}

.acme-form input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Choice options container — always allow wrapping, constrain to parent */
.acme-choice-options {
    flex-wrap: wrap !important;
    max-width: 100%;
    overflow: hidden;
}

/* Choice checkboxes – bordered container per option */
.acme-choice-checkboxes .acme-choice-option,
.acme-choice-radios .acme-choice-option {
    user-select: none;
    -webkit-user-select: none;
    white-space: nowrap;
}

.acme-choice-checkboxes .acme-choice-option {
    border-radius: 8px;
    padding: 0;
    background: #fff;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    padding-left: 0;
}

.acme-choice-checkboxes .acme-choice-option input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 2px 0 0 0;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid #c0c0c0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
}

.acme-choice-checkboxes .acme-choice-option input[type="checkbox"]:checked {
    background: #4fb5a9;
    border-color: #4fb5a9;
}

.acme-choice-checkboxes .acme-choice-option input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Choice radios – custom radio styling */
.acme-choice-radios .acme-choice-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.acme-choice-radios .acme-choice-option input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #c0c0c0;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s ease;
}

.acme-choice-radios .acme-choice-option input[type="radio"]:checked {
    border-color: #094345;
}

.acme-choice-radios .acme-choice-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #094345;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Choice field group label */
.acme-choice-group-label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

/* Choice label left alignment */
.acme-choice-label-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.acme-choice-label-left .acme-choice-group-label {
    margin-bottom: 0;
    white-space: nowrap;
    padding-top: 4px;
}

/* Date field */
.acme-date-input {
    cursor: pointer;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

/* Hide native date text when empty, show placeholder instead */
.acme-date-input:not(.acme-date-has-value)::-webkit-datetime-edit,
.acme-date-input:not(.acme-date-has-value)::-webkit-datetime-edit-fields-wrapper,
.acme-date-input:not(.acme-date-has-value)::-webkit-datetime-edit-text,
.acme-date-input:not(.acme-date-has-value)::-webkit-datetime-edit-month-field,
.acme-date-input:not(.acme-date-has-value)::-webkit-datetime-edit-day-field,
.acme-date-input:not(.acme-date-has-value)::-webkit-datetime-edit-year-field {
    -webkit-appearance: none;
    display: none;
}

.acme-date-input:not(.acme-date-has-value)::before {
    content: attr(data-placeholder);
    color: #999;
    pointer-events: none;
}

.acme-date-input::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

input[type="number"], input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type=date], input[type="search"], select, textarea{
    font-size: 14px !important;
    color: #094345 !important;
}


.acme-field{
    font-size: 17px;
    color: #094345;
}

.acme-field select{
    background: #f7f7f7;
}

/* Steps bar */
.acme-steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 20px;
    gap: 0;
}

.acme-step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.acme-step-indicator.acme-step-active {
    opacity: 1;
}

.acme-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #094345;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.acme-step-indicator:not(.acme-step-active) .acme-step-number {
    background: #c0c0c0;
}

.acme-step-label {
    font-size: 14px;
    font-weight: 600;
    color: #094345;
    white-space: nowrap;
}

.acme-step-indicator:not(.acme-step-active) .acme-step-label {
    color: #999;
}

.acme-step-separator {
    width: 40px;
    height: 2px;
    background: #e0e0e0;
    margin: 0 12px;
    flex-shrink: 0;
}

/* Spacing between stepper and content below */
.acme-steps-bar + .acme-calcom-step,
.acme-steps-bar + .acme-form-step {
    padding-top: 4px;
}

/* Cal.eu step */
.acme-calcom-step {
    width: 100%;
    text-align: center;
}

.acme-calcom-step .acme-calcom-embed {
    min-width: 320px;
    height: 630px;
}

.acme-calcom-next-btn {
    display: inline-block;
    width: auto;
    margin-top: 12px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background: #4fb5a9;
    color: #fff;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.acme-calcom-next-btn:hover:not(:disabled) {
    background: #3d9e93;
}

.acme-calcom-next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form step wrapper - inherit row layout from parent form */
.acme-form-step {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
    padding: 0;
}

.acme-form.row > .acme-form-step {
    display: contents;
}

/* ── Mobile responsive (≤ 640px) ── */
@media (max-width: 640px) {
    /* Choice label-left: stack label above options */
    .acme-choice-label-left {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .acme-choice-label-left .acme-choice-group-label {
        white-space: normal;
        padding-top: 0;
    }

    /* Force column layout for choice options on small screens */
    .acme-choice-radios .acme-choice-options,
    .acme-choice-checkboxes .acme-choice-options {
        flex-direction: column !important;
    }

    /* Larger touch targets for radio/checkbox options */
    .acme-choice-radios .acme-choice-option,
    .acme-choice-checkboxes .acme-choice-option {
        min-height: 44px;
        padding: 10px 0;
        white-space: normal;
    }

    /* Inputs full width + vertically centered placeholder */
    .acme-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .acme-form select,
    .acme-form textarea {
        width: 100% !important;
        box-sizing: border-box;
        line-height: 1.4;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .acme-form select {
        height: auto;
    }
}