/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #004C80 0%, #0066A6 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    position: relative;
    overflow-x: hidden;
}

/* Desktop Layout */
@media (min-width: 769px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
    }
    
    .container {
        max-width: 1000px;
        width: 100%;
        min-height: auto;
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        overflow: hidden;
        display: grid;
        grid-template-columns: 320px 1fr;
        grid-template-rows: auto 1fr;
        max-height: 90vh;
    }
    
    .header {
        grid-column: 1 / -1;
        padding: 24px 32px;
    }
    
    .logo {
        height: 45px;
    }
    
    .progress-container {
        grid-column: 1;
        padding: 40px 32px;
        display: flex;
        align-items: flex-start;
        background: #004C80;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .progress-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 40px;
        width: 100%;
    }
    
    .step {
        flex-direction: row;
        align-items: center;
        gap: 16px;
        width: 100%;
    }
    
    .step-circle {
        width: 48px;
        height: 48px;
        font-size: 18px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .step-label {
        font-size: 15px;
        text-align: left;
        font-weight: 500;
    }
    
    .step.active .step-label {
        font-weight: 600;
    }
    
    .step-line {
        display: none;
    }
    
    .form-container {
        grid-column: 2;
        padding: 48px 56px;
        overflow-y: auto;
        max-height: calc(90vh - 80px);
    }
    
    .step-title {
        font-size: 28px;
        text-align: left;
        margin-bottom: 40px;
    }
    
    .form-group {
        margin-bottom: 28px;
    }
    
    .form-group label {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .input-wrapper input,
    .select-wrapper select {
        padding: 18px 18px 18px 52px;
        font-size: 16px;
    }
    
    .input-icon {
        left: 18px;
        font-size: 18px;
    }
    
    .phone-wrapper {
        gap: 16px;
    }
    
    .country-code {
        min-width: 120px;
        padding: 0 16px;
    }
    
    .password-criteria {
        margin-bottom: 32px;
    }
    
    .password-criteria h3 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .criteria-box {
        padding: 20px;
    }
    
    .criteria-item {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .criteria-icon {
        width: 18px;
        height: 18px;
        margin-right: 14px;
    }
    
    .btn-next,
    .btn-submit {
        padding: 18px 32px;
        font-size: 17px;
    }
    
    .btn-back {
        padding: 16px 28px;
        font-size: 15px;
    }
    
    .step-buttons {
        gap: 16px;
        margin-top: 40px;
    }
    
    /* Scrollbar personalizada para desktop */
    .form-container::-webkit-scrollbar {
        width: 8px;
    }
    
    .form-container::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    .form-container::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }
    
    .form-container::-webkit-scrollbar-thumb:hover {
        background: #a1a1a1;
    }
}

/* Header */
.header {
    background: #004C80;
    padding: 20px 24px;
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* Barra de Progresso */
.progress-container {
    background: #004C80;
    padding: 30px 24px 40px;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

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

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.step.active .step-circle {
    background: #FF6B35;
    border-color: #FF6B35;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.step.completed .step-circle {
    background: #FF6B35;
    border-color: #FF6B35;
    color: white;
}

.step-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-align: center;
}

.step.active .step-label {
    color: white;
    font-weight: 600;
}

.step-line {
    position: absolute;
    top: 20px;
    left: 50%;
    right: 50%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 1;
    transition: all 0.3s ease;
}

.step:first-child .step-line {
    left: 50%;
    width: 50%;
}

.step:last-child .step-line {
    right: 50%;
    width: 50%;
}

.step:not(:first-child):not(:last-child) .step-line {
    width: 100%;
    left: 0;
}

.step.completed + .step-line,
.step.active + .step-line {
    background: #FF6B35;
}

/* Formulário */
.form-container {
    padding: 32px 24px 40px;
}

.step-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

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

.step-title {
    font-size: 24px;
    font-weight: 700;
    color: #004C80;
    margin-bottom: 32px;
    text-align: center;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #004C80;
    box-shadow: 0 0 0 3px rgba(0, 76, 128, 0.1);
}

.input-wrapper input:valid {
    border-color: #10B981;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #6B7280;
    font-size: 16px;
    z-index: 2;
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:valid + .input-icon {
    color: #004C80;
}

/* Select Wrapper */
.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.select-wrapper select {
    width: 100%;
    padding: 16px 48px 16px 48px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-wrapper select:focus {
    outline: none;
    border-color: #004C80;
    box-shadow: 0 0 0 3px rgba(0, 76, 128, 0.1);
}

.select-arrow {
    position: absolute;
    right: 16px;
    color: #6B7280;
    font-size: 14px;
    pointer-events: none;
}

/* Nationality Flag */
.nationality-flag {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nationality-flag .fi {
    font-size: 20px;
    line-height: 1;
}

.select-wrapper select {
    padding-left: 45px;
}

/* Phone Wrapper */
.phone-wrapper {
    display: flex;
    gap: 12px;
}

.country-code {
    display: flex;
    align-items: center;
    background: #F9FAFB;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    padding: 0 12px;
    min-width: 100px;
}

.flag {
    font-size: 20px;
    margin-right: 8px;
}

.country-code select {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    appearance: none;
    cursor: pointer;
}

.phone-wrapper input {
    flex: 1;
    padding: 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.phone-wrapper input:focus {
    outline: none;
    border-color: #004C80;
    box-shadow: 0 0 0 3px rgba(0, 76, 128, 0.1);
}

/* Password Criteria */
.password-criteria {
    margin-bottom: 24px;
}

.password-criteria h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.criteria-box {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 16px;
}

.criteria-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6B7280;
}

.criteria-item:last-child {
    margin-bottom: 0;
}

.criteria-icon {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    color: #EF4444;
    transition: all 0.3s ease;
}

.criteria-item.valid .criteria-icon {
    color: #10B981;
}

.criteria-item.valid {
    color: #10B981;
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #004C80;
}

/* Buttons */
.btn-next,
.btn-submit {
    width: 100%;
    padding: 16px 24px;
    background: #9CA3AF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-next:not(:disabled),
.btn-submit:not(:disabled) {
    background: #004C80;
    cursor: pointer;
    transform: translateY(0);
}

.btn-next:not(:disabled):hover,
.btn-submit:not(:disabled):hover {
    background: #003A66;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 76, 128, 0.3);
}

.btn-next:not(:disabled):active,
.btn-submit:not(:disabled):active {
    transform: translateY(0);
}

.btn-back {
    background: transparent;
    color: #6B7280;
    border: 2px solid #E5E7EB;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #374151;
}

.step-buttons {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.step-buttons .btn-next,
.step-buttons .btn-submit {
    flex: 2;
    margin-top: 0;
}

.step-buttons .btn-back {
    flex: 1;
}

/* reCAPTCHA */
.recaptcha-container {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

.g-recaptcha {
    transform: scale(0.9);
    transform-origin: center;
}

/* Tablet Layout */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        max-width: 600px;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }
    
    .form-container {
        padding: 36px 32px 40px;
    }
    
    .header {
        padding: 20px 28px;
    }
    
    .progress-container {
        padding: 28px 28px 36px;
    }
    
    .step-title {
        font-size: 22px;
        margin-bottom: 28px;
    }
    
    .form-group {
        margin-bottom: 22px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    .form-container {
        padding: 24px 20px 32px;
    }
    
    .header {
        padding: 16px 20px;
    }
    
    .progress-container {
        padding: 24px 20px 32px;
    }
    
    .step-circle {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .step-label {
        font-size: 11px;
    }
    
    .step-title {
        font-size: 20px;
        margin-bottom: 24px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .input-wrapper input,
    .select-wrapper select {
        padding: 14px 14px 14px 44px;
        font-size: 16px;
    }
    
    .phone-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .country-code {
        min-width: auto;
        width: 100%;
        justify-content: center;
    }
    
    .g-recaptcha {
        transform: scale(0.8);
    }
}

@media (max-width: 360px) {
    .form-container {
        padding: 20px 16px 28px;
    }
    
    .header {
        padding: 14px 16px;
    }
    
    .progress-container {
        padding: 20px 16px 28px;
    }
    
    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .step-title {
        font-size: 18px;
    }
    
    .input-wrapper input,
    .select-wrapper select {
        padding: 12px 12px 12px 40px;
    }
    
    .btn-next,
    .btn-submit {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .g-recaptcha {
        transform: scale(0.75);
    }
}

/* Estados de validação */
.form-group.error input,
.form-group.error select {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group.success input,
.form-group.success select {
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.error-message {
    color: #EF4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth transitions */
* {
    transition: all 0.3s ease;
}

input, select, button {
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid #004C80;
    outline-offset: 2px;
}

input:focus,
select:focus,
button:focus {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .step-circle {
        border-width: 3px;
    }
    
    input, select {
        border-width: 3px;
    }
    
    .btn-next, .btn-submit, .btn-back {
        border-width: 3px;
    }
}