/* =============================================
   COUNTRY SELECT (custom-select-*)
   ============================================= */

.custom-select-container {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.custom-select-selected {
    display: flex;
    align-items: center;
    padding: 0.66rem 1rem;
    background: #fff;
    color: black;
    border: solid 2px black;
    border-radius: 5px;
    gap: 10px;
    min-height: 50px;
    max-height: 50px;
}

.custom-select-dropdown {
    position: absolute;
    top: 105%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.custom-select-option {
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 10px;
    color: #333;
    transition: background 0.1s ease;
    cursor: pointer;
}

.custom-select-option:hover {
    background-color: #767676;
    color: white;
}

.flag-icon {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

.select-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #718096;
    pointer-events: none;
    flex-shrink: 0;
}

.select-icon.open {
    transform: translateY(-50%) rotate(180deg);
}

.search-container {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.dropdown-list {
    max-height: 240px;
    overflow-y: auto;
}

/* =============================================
   CUSTOMER FORM (cf-*) - Design System Padrao
   ============================================= */

/* Card */
.cf-card {
    display: flex;
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    width: 100%;
    gap: 10px;
    flex-direction: column;
    padding: 2rem;
    animation: cfFadeInUp 0.4s ease-out forwards;
}

.cf-title {
    font-size: 1.95rem;
    font-weight: 700;
    color: #2d3748;
    text-align: center;
    margin-bottom: 1rem;
}

/* Step Indicator */
.cf-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 1rem;
}

.cf-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.cf-step-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .cf-step-circle.cf-step-active {
        background: var(--primary-color, #E40E18);
        color: white;
        box-shadow: 0 4px 14px color-mix(in srgb, var(--primary-color), transparent 35%);
        transform: scale(1.1);
    }

.cf-step-circle.cf-step-completed {
    background: var(--primary-color, #E40E18);
    color: white;
}

.cf-step-circle.cf-step-inactive {
    background: #d9d9d9cf;
    color: #718096;
}

.cf-check-icon {
    width: 1rem;
    height: 1rem;
}

.cf-step-title {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-color);
    text-align: center;
}

.cf-step-title.cf-step-title-active {
    color: var(--text-color);
}

.cf-step-line {
    flex: 1;
    height: 0.25rem;
    margin: 0 -10px;
    min-width: 20px;
    border-radius: 9999px;
    background: #f7fafc;
    transition: all 0.5s ease;
    align-self: center;
    margin-bottom: 1.5rem;
}

.cf-step-line.cf-step-line-active {
    background: var(--primary-color, #E40E18);
}

/* Alert */
.cf-alert {
    background: rgba(229, 62, 62, 0.1);
    color: red;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 1.2rem;
    text-align: center;
    margin-top: -15px;
}

/* Step Content */
.cf-step-content {
    margin-bottom: 1rem;
}

/* Form Elements */
.cf-form-group {
    margin-bottom: 1rem;
}

.cf-label {
    display: block;
    font-size: 1.2rem;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.cf-label-info {
    display: flex;
    gap: 10px;
}

.cf-info-icon {
    margin-bottom: 5px;
}

.cf-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .cf-form-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .cf-step-line {
        width: 6rem;
    }
}

.cf-input-wrapper {
    position: relative;
}

.cf-input {
    min-height: 50px;
    max-height: 50px;
    width: 100%;
    max-width: 100%;
    padding: 0.875rem 1rem;
    padding-right: 2.1rem;
    background: transparent;
    border: solid 2px #000000;
    border-radius: 5px;
    outline: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.cf-input::placeholder {
    color: #718096;
}

.cf-input:focus {
    border-bottom-color: var(--text-color);
}

.cf-input.has-error,
.cf-input.invalid {
    border-color: #e53e3e !important;
    border-width: 2px !important;
}

.cf-select.invalid {
    border-color: #e53e3e !important;
    border-width: 2px !important;
}

.cf-input-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #718096;
    pointer-events: none;
}

/* Select */
.cf-select-wrapper {
    position: relative;
}

.cf-select {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-right: 2.5rem;
    background: transparent;
    border: solid 2px #000000;
    border-radius: 5px;
    outline: none;
    font-size: 1rem;
    color: #2d3748;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
    min-height: 50px;
    max-height: 50px;
}

.cf-select:focus {
    border-bottom-color: var(--text-color);
}

.cf-select-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #718096;
    pointer-events: none;
}

/* Phone */
.cf-phone-group {
    display: flex;
    gap: 2px;
    align-items: stretch;
}

/* Confirmation */
.cf-confirmation {
    background: rgba(232, 90, 113, 0.08);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.cf-confirmation h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.cf-confirmation p {
    font-size: 1.275rem;
}

/* Terms */
.cf-terms-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.cf-terms-box.cf-terms-box-active {
    border-color: #E85A71;
    background: rgba(232, 90, 113, 0.05);
}

.cf-checkbox {
    width: 1rem;
    height: 1rem;
    margin-top: 0.125rem;
    accent-color: #E85A71;
    cursor: pointer;
}

.cf-terms-label {
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.5;
    flex: 1;
}

.cf-terms-link {
    color: #E85A71;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.cf-terms-link:hover {
    text-decoration: underline;
}

.cf-external-icon {
    width: 0.75rem;
    height: 0.75rem;
}

/* Buttons */
.cf-button-group {
    display: flex;
    gap: 1rem;
}

.cf-btn-primary,
.cf-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    width: 60%;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    flex: 1;
}

.cf-btn-primary {
    background: var(--primary-color, #E40E18);
    color: white;
}

.cf-btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 14px rgba(232, 90, 113, 0.4);
}

.cf-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cf-btn-secondary {
    background: transparent;
    color: #2d3748;
    border: 2px solid #919191;
}

.cf-btn-secondary:hover:not(:disabled) {
    border-color: var(--primary-color);
}

.cf-btn-icon {
    width: 1rem;
    height: 1rem;
}

/* Spinner */
.cf-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: cfSpin 0.8s linear infinite;
}

@keyframes cfSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal */
.cf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    margin-left: -140px;
}

.cf-modal-info {
    z-index: 20;
    margin-left: 140px;
}

.cf-modal-info p {
    background-color: #fffa00;
    text-align: center;
    font-weight: 500;
    border-radius: 8px;
    padding: 10px;
    width: 220px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 0.94rem;
}

/* Animation */
@keyframes cfFadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .cf-card {
        padding: 1.5rem;
    }

    .cf-title {
        font-size: 1.5rem;
    }

    .cf-form-row {
        gap: 0px;
    }

    .cf-step-circle {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 1.2rem;
    }

    .cf-step-title {
        font-size: 1.2rem;
    }

    .cf-step-line {
        width: 2rem;
    }
}
