.apx-lead {
    --apx-accent: #c8102e;
    --apx-bg: #ffffff;
    --apx-text: #000000;
    --apx-muted: #999999;
    --apx-border: #000000;
    --apx-radius: 15px;
    --apx-max: 400px;

    box-sizing: border-box;
    width: 100%;
    max-width: var(--apx-max);
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%);
    border-radius: 10px;
}

.apx-lead * {
    box-sizing: border-box;
}

.apx-lead .apx-lead-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.apx-lead .apx-lead-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.apx-lead .apx-lead-row>* {
    flex: none;
    width: 100%;
    min-width: 0;
}

.apx-lead input[type="text"]:not(.iti__search-input),
.apx-lead input[type="email"] {
    width: 100%;
    min-height: auto;
    padding: 25px 15px;
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    color: var(--apx-text);
    background: var(--apx-bg);
    border: 1px solid var(--apx-border);
    border-radius: var(--apx-radius);
    outline: none;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.apx-lead input:not(.iti__search-input)::placeholder {
    color: var(--apx-muted);
    opacity: 1;
}

.apx-lead input[type="text"]:not(.iti__search-input):focus,
.apx-lead input[type="email"]:focus {
    border-color: #c8102e;
    box-shadow: none;
}

.apx-lead .iti {
    position: relative;
    width: 100%;
    display: block;
    border: 1px solid var(--apx-border);
    border-radius: var(--apx-radius);
    overflow: visible;
    background: var(--apx-bg);
}

.apx-lead .iti__country-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: stretch;
    z-index: 2;
}

.apx-lead .iti__selected-country {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    margin: 0;
    padding: 0 10px;
    background: transparent;
    border: none;
    border-radius: var(--apx-radius) 0 0 var(--apx-radius);
    cursor: pointer;
}

.apx-lead .iti__selected-country-primary {
    display: flex;
    align-items: center;
}

.apx-lead .iti__selected-dial-code {
    color: var(--apx-text);
    font-size: 16px;
}

.apx-lead .iti input[type="tel"] {
    width: 100%;
    min-height: auto;
    padding: 25px 15px;
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    color: var(--apx-text);
    background: transparent !important;
    border: none !important;
    border-radius: var(--apx-radius) !important;
    outline: none;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.apx-lead .iti:focus-within {
    border-color: #c8102e;
}

.apx-lead button.submit {
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: var(--apx-accent);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.apx-lead button.submit:hover {
    background-color: #8b0a1a;
}

.apx-lead button.submit:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Phone dropdown overlay safety */
.iti--container {
    z-index: 99999;
}

.iti--container.iti--fullscreen-popup {
    pointer-events: none;
}

.iti--container.iti--fullscreen-popup .iti__dropdown-content {
    pointer-events: auto;
}

.apx-lead .iti__dropdown-content {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.apx-lead .iti__search-input {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 12px;
    margin: 0;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    line-height: 1.3;
    color: #000;
    background: #fff;
    border-radius: 0;
}

.apx-lead .iti__country-list {
    position: static !important;
    z-index: auto;
    width: 100% !important;
    max-height: 200px;
    margin: 0;
    padding: 0;
    background: #fff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow-y: auto;
}

.apx-lead .iti__country {
    padding: 10px 12px;
    color: #000;
    border-radius: 0;
}

.apx-lead .iti__country.iti__highlight,
.apx-lead .iti__country:hover {
    background: #f5f5f5;
}

.apx-lead .iti__country-name,
.apx-lead .iti__dial-code {
    color: #333;
}

@media (max-width: 480px) {
    .apx-lead {
        padding: 20px 16px;
    }
}