* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --error-color: #dc3545;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --border-radius: 12px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 30px 24px;
    animation: fadeInUp 0.5s ease-out;
}

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

.header {
    text-align: center;
    margin-bottom: 32px;
}

.header-logo {
    max-width: 140px;
    height: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0 10px;
}

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

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 14px;
}

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

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

.step-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
    display: none;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 8px;
    margin-top: -20px;
    transition: var(--transition);
}

.progress-line.completed {
    background: var(--success-color);
}

/* Form Steps */
.form-container {
    position: relative;
    min-height: 400px;
}

.form-step {
    display: none;
    animation: slideIn 0.4s ease-out;
}

.form-step.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-step h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.step-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.optional {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 12px;
}

.required-asterisk {
    color: var(--error-color);
    font-weight: 600;
    margin-left: 2px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group input::placeholder {
    color: #adb5bd;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.error-message {
    display: block;
    color: var(--error-color);
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
}

/* Autocomplete Styles */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    margin-top: -2px;
}

.autocomplete-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    font-size: 14px;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background: rgba(0, 102, 204, 0.05);
    color: var(--primary-color);
}

.autocomplete-suggestion .suggestion-street {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.autocomplete-suggestion .suggestion-details {
    font-size: 12px;
    color: var(--text-secondary);
}

.autocomplete-suggestion:hover .suggestion-street,
.autocomplete-suggestion.selected .suggestion-street {
    color: var(--primary-color);
}

.hidden {
    display: none !important;
}

.success-page.hidden {
    display: none !important;
}

.success-page:not(.hidden) {
    display: block !important;
}

/* Option Cards - Botões Interativos */
.option-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 8px;
}

.option-cards-inline {
    grid-template-columns: repeat(3, 1fr);
}

.option-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 120px;
    justify-content: center;
}

.option-card-small {
    padding: 16px 12px;
    min-height: 100px;
}

.option-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: #f8f9ff;
}

.option-card.selected {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.option-icon {
    font-size: 32px;
    margin-bottom: 4px;
    line-height: 1;
}

.option-card-small .option-icon {
    font-size: 28px;
}

.option-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-top: 4px;
}

.option-card-small .option-title {
    font-size: 14px;
}

.option-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Number Options - Botões de Números */
.number-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.number-option {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 80px;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.number-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: #f8f9ff;
}

.number-option.selected {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.number-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.number-option.selected .number-value {
    color: var(--primary-color);
}

.number-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.number-option-more {
    grid-column: span 2;
}

/* Buttons */
.form-navigation {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled,
.btn-primary[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto;
}
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: var(--text-secondary);
}

/* Review Container */
.review-container {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.review-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.review-item:last-child {
    border-bottom: none;
}

.review-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.review-value {
    color: var(--text-primary);
    text-align: right;
}

/* Loading State */
.loading-container {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-container p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Tela de Loading Completa */
.loading-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 64px;
    height: 64px;
    border: 5px solid rgba(0, 102, 204, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

.loading-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

/* Success State */
.success-container {
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.5s ease-out;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.success-container h3 {
    font-size: 24px;
    color: var(--success-color);
    margin-bottom: 8px;
}

.success-container p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Página de Confirmação Completa */
/* Tela de Confirmação CPF Já Cadastrado */
.cpf-exists-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.cpf-exists-page.hidden {
    display: none;
}

.cpf-exists-content {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

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

.cpf-exists-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.cpf-exists-title {
    font-size: 1.75rem;
    color: #333;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.cpf-exists-message {
    font-size: 1rem;
    color: #666;
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

.cpf-exists-question {
    font-size: 1rem;
    color: #333;
    margin: 0 0 2rem 0;
    font-weight: 500;
}

.cpf-exists-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cpf-exists-buttons .btn {
    min-width: 140px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

@media (max-width: 480px) {
    .cpf-exists-content {
        padding: 2rem 1.5rem;
    }
    
    .cpf-exists-title {
        font-size: 1.5rem;
    }
    
    .cpf-exists-buttons {
        flex-direction: column;
    }
    
    .cpf-exists-buttons .btn {
        width: 100%;
    }
}

.success-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeInUp 0.6s ease-out;
    padding: 20px;
    box-sizing: border-box;
}

.success-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    position: relative;
    padding: 40px 20px;
    min-height: 100vh;
}

.success-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.success-check-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--success-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 700;
    margin: 0 auto 32px;
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.3);
    animation: scaleIn 0.5s ease-out;
    flex-shrink: 0;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--success-color);
    line-height: 1.3;
    margin: 0;
}

.success-logo {
    max-width: 180px;
    height: auto;
    margin-top: auto;
    opacity: 0.8;
    display: block;
}

@media (max-width: 640px) {
    .header-logo {
        max-width: 120px;
        margin-bottom: 16px;
    }
    
    .success-check-icon {
        width: 100px;
        height: 100px;
        font-size: 54px;
        margin-bottom: 24px;
    }
    
    .success-logo {
        max-width: 140px;
        bottom: 30px;
    }
    
    .success-title {
        font-size: 28px;
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 24px 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .progress-bar {
        margin-bottom: 32px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .step-label {
        display: none;
    }

    .form-step h2 {
        font-size: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .option-cards-inline {
        grid-template-columns: 1fr;
    }

    .number-options {
        grid-template-columns: repeat(3, 1fr);
    }

    .number-option-more {
        grid-column: span 3;
    }

    .option-card {
        min-height: 100px;
        padding: 16px;
    }

    .option-card-small {
        min-height: 90px;
        padding: 14px 10px;
    }

    .form-navigation {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (min-width: 641px) {
    .step-label {
        display: block;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

