/* Polycor Lead Form */
/* Step indicator + progress bar */
.pef-progress-wrap {
    margin-bottom: 20px;
}

.pef-step-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 6px;
}

.pef-progress-track {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.pef-progress-bar {
    height: 100%;
    background: #2c5282;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.pef-form-wrap {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.pef-form-header {
    margin-bottom: 32px;
}

.pef-form-header h2 {
    font-size: 40px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--global-palette3);
    line-height: 1.1em;
}

.pef-form-header p {
    font-size: 20px;
    line-height: 1.4;
}

/* Fields */
.pef-field {
    margin-bottom: 18px;
}

.pef-field label {
    display: block;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.pef-required {
    color: #d63031;
}

.pef-optional {
    color: #999;
    font-weight: 400;
    font-size: 13px;
}

.pef-field .pef-helper, .pef-helper {
    font-size: 14px;
    color: #999;
    margin: 6px 0 0;
    font-weight: 400;
    font-style: italic;
}

.pef-field input[type="text"],
.pef-field input[type="email"],
.pef-field input[type="tel"],
.pef-field select,
.pef-field textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 2px solid #c4c4c4;
    border-radius: 6px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.pef-field .pef-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pef-privacy-policy {
    margin-top: 20px;
}

.pef-field [type=checkbox] {
    min-width: 20px;
}

/* Tom Select — match form field style */
.pef-field .ts-wrapper {
    width: 100%;
    position: relative;
}

/* Dropdown caret arrow */
.pef-field .ts-wrapper.single::after {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    right: 14px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
    z-index: 2;
    transition: transform 0.2s ease;
}

.pef-field .ts-wrapper.single.dropdown-active::after {
    transform: translateY(-35%) rotate(-135deg);
}

.pef-field .ts-wrapper.single .ts-control {
    padding: 10px 36px 10px 14px !important;
    font-size: 15px !important;
    border: 2px solid #c4c4c4 !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #333 !important;
    box-shadow: none !important;
    min-height: 46px;
    max-height: 46px;
    cursor: pointer;
}

.pef-field .ts-wrapper.single .ts-control > .item {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 18px !important;
    color: #333 !important;
    border-radius: 0 !important;
    line-height: 1.4 !important;
}

/* When focused: show selected item as faded placeholder behind the input */
.pef-field .ts-wrapper.single.focus .ts-control > .item {
    color: #999 !important;
    position: absolute !important;
    pointer-events: none !important;
    transition: none !important;
}

/* When dropdown is open and filtering, hide the placeholder instantly */
.pef-field .ts-wrapper.single.focus.dropdown-active .ts-control > .item {
    opacity: 0 !important;
}

.pef-field .ts-wrapper.single.focus .ts-control {
    border-color: #2c5282 !important;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1) !important;
    outline: none !important;
}

/* Search input always visible and full-width when focused */
.pef-field .ts-wrapper.single .ts-control input {
    font-size: 15px !important;
    color: #333 !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
    z-index: 1 !important;
}

.pef-field .ts-wrapper.single .ts-control input::placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

/* When not focused and has a value, hide the input so only the selected item shows */
.pef-field .ts-wrapper.single:not(.focus).has-items .ts-control input {
    width: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
}

.pef-field .ts-dropdown {
    font-size: 15px !important;
    border: 2px solid #2c5282 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    margin-top: 2px !important;
}

.pef-field .ts-dropdown .option {
    padding: 9px 14px;
    color: #333;
    font-size: 18px;
}

.pef-field .ts-dropdown .option:hover,
.pef-field .ts-dropdown .option.active {
    background: #2c5282;
    color: #fff;
}

.pef-field .ts-dropdown .option.selected {
    background: #2c5282;
    color: #fff;
}

.pef-field input:focus,
.pef-field select:focus,
.pef-field textarea:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.pef-field textarea {
    resize: vertical;
    min-height: 100px;
}

.pef-field select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

/* Radio group */
.pef-radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.pef-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    cursor: pointer;
}

.pef-radio input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.disclaimer-field {
    margin-top: 32px;
    margin-bottom: 25px;
    font-style: italic;
    color: #333;
}

/* Submit */
.pef-submit-row {
    margin-top: 32px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-direction: column;
}

.pef-btn {
    padding: 12px 32px;
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.pef-btn:active {
    transform: scale(0.98);
}

.pef-btn-primary {
    background: #eeb411;
    color: #fff;
    text-transform: uppercase;
}

.pef-btn-primary:hover {
    background: #717073;
}

.pef-btn-primary:disabled {
    background: #7a9cc6;
    cursor: not-allowed;
}

.pef-skip-link {
    font-size: 13px;
    color: #888;
    text-decoration: underline;
}

.pef-skip-link:hover {
    color: #555;
}

#pef-result-rep .pef-sub {
    font-weight: 600;
    color: var(--global-palette1);
    text-transform: uppercase;
    font-size: 20px;
}

/* Field-level error highlight */
.pef-field-error input[type="text"],
.pef-field-error input[type="email"],
.pef-field-error input[type="tel"],
.pef-field-error select,
.pef-field-error textarea {
    border-color: #c53030;
}

.pef-field-error .ts-wrapper.single .ts-control {
    border-color: #c53030 !important;
}

.pef-field-error input[type="checkbox"] {
    outline: 2px solid #c53030;
    outline-offset: 2px;
}

/* Errors */
.pef-errors {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 12px 16px;
    margin-top: 12px;
}

.pef-errors ul {
    margin: 0;
    padding: 0 0 0 18px;
}

.pef-errors li {
    font-size: 13px;
    color: #c53030;
    line-height: 1.5;
}

/* Result — generic fallback */
.pef-result-inner {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

.pef-success-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #c6f6d5;
    color: #276749;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-top: 8px;
}

.pef-success-content h2 {
    margin: 0 0 12px;
}

.pef-success-content p {
    font-size: 18px;
}

.pef-result-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 25px;
    margin-top: 0;
}

.pef-result-card p {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.5em;
    color: #666;
}

/* Result — matched rep */
.pef-result-headline {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.pef-result-headline span {
    color: #c8a415;
}

.pef-result-subtext {
    font-size: 18px;
    margin: 0 0 16px;
}

.pef-result-subtext, .pef-result-context {
    margin-bottom: 12px !important;
}

.pef-result-context {
    font-size: 18px;
    color: #333;
    line-height: 1.6;
    margin: 0 0 24px;
}

.pef-result-context strong {
    font-weight: 600;
}

.pef-rep-card {
    display: flex;
    gap: 32px;
    align-items: center;
    margin-top: 8px;
    padding-top: 32px;
    border-top: 1px solid #ccc;
}

.pef-rep-image-wrap {
    flex-shrink: 0;
}

.pef-rep-image-wrap img {
    width: 190px;
    height: 190px;
    object-fit: cover;
    border-radius: 0;
}

.pef-rep-details h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.pef-rep-label {
    font-size: 13px;
    color: #888;
    margin: 0 0 8px;
    font-style: italic;
}

.pef-rep-details p {
    margin: 0 0 4px;
    font-size: 18px;
    color: #333;
}

.pef-rep-details a {
    color: #c8a415;
    text-decoration: none;
}

.pef-rep-details a:hover {
    text-decoration: underline;
}

/* Phase transitions */
.pef-phase {
    animation: pefFadeIn 0.3s ease;
}

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

/* Responsive */
@media (max-width: 600px) {
    .pef-form-wrap {
        padding: 0 16px;
    }

    .pef-submit-row {
        flex-direction: column;
        align-items: stretch;
    }

    .pef-btn {
        width: 100%;
        text-align: center;
    }

    .pef-skip-link {
        text-align: center;
    }

    .pef-radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .pef-field-row {
        flex-direction: column;
        gap: 0 !important;
    }

}