/* ============================================
   VARIABLES & RESET
   ============================================ */
:root {
    --color-primary: #4c387d;
    --color-primary-dark: #4c387d;
    --color-primary-light: #4c387da6;
    --color-accent: #ff24d79f;
    --color-accent-dark: #ff24d8;
    --color-accent-light: #ff24d78a;
    --color-white: #ffffff;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: rgba(255, 255, 255, 0.2);
    --color-error: #ff4444;
    --color-success: #00c851;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px a8498a9e;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
    color: var(--color-white);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, #a8498a9e 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, #a8498a9e 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes backgroundMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, -20px) scale(1.1); }
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER & LOGO
   ============================================ */
.header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease-out;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.logo-image {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    animation: logoFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    border-radius: var(--radius-md);
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@media (max-width: 480px) {
    .logo-image {
        max-height: 150px;
    }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0;
}

.form-wrapper {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--color-white);
}

.form-subtitle {
    font-size: 1rem;
    color: var(--color-accent);
    margin-bottom: 10px;
}

.form-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    border-radius: 2px;
    transition: width var(--transition-slow) ease;
    width: 20%;
    box-shadow: 0 0 10px #a8498a84;
}

.steps-indicator {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: all var(--transition-normal);
}

.step-item.active {
    opacity: 1;
}

.step-number {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    border: 2px solid transparent;
    transition: all var(--transition-normal);
}

.step-item.active .step-number {
    background: var(--color-accent);
    color: var(--color-primary);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
    animation: stepPulse 2s ease-in-out infinite;
}

@keyframes stepPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.step-label {
    font-size: 0.7rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    display: none;
}

@media (min-width: 480px) {
    .step-label {
        display: block;
    }
}

/* ============================================
   FORM STEPS
   ============================================ */
.form {
    position: relative;
}

.form-step {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInReverse {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-header {
    margin-bottom: 25px;
    text-align: center;
}

.step-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-white);
}

.step-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-white);
    font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--color-white);
    font-size: 1rem;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px #a8498a57;
    transform: translateY(-2px);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 480px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Phone Input */
.phone-input-wrapper {
    display: flex;
    gap: 10px;
}

.phone-country {
    flex-shrink: 0;
    width: 100px;
    padding: 14px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--color-white);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.phone-country:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px #a8498a49;
}

.phone-input {
    flex: 1;
}

/* Radio & Checkbox */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.radio-option::before,
.checkbox-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #a8498a1e, transparent);
    transition: left 0.5s;
}

.radio-option:hover::before,
.checkbox-option:hover::before {
    left: 100%;
}

.radio-option:hover,
.checkbox-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #a8498a50;
    transform: translateX(5px);
}

.radio-option input,
.checkbox-option input {
    display: none;
}

.radio-custom,
.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: relative;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.checkbox-custom {
    border-radius: 4px;
}

.radio-option input:checked + .radio-custom,
.checkbox-option input:checked + .checkbox-custom {
    border-color: var(--color-accent);
    background: var(--color-accent);
    box-shadow: 0 0 10px #a8498a9e;
}

.radio-option input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
}

.checkbox-option input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-primary);
    font-weight: bold;
    font-size: 14px;
}

.radio-text,
.checkbox-text {
    flex: 1;
    color: var(--color-white);
    font-size: 0.95rem;
}

.radio-option input:checked ~ .radio-text,
.checkbox-option input:checked ~ .checkbox-text {
    color: var(--color-accent);
    font-weight: 600;
}

/* Select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FAA806' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-select option {
    background: #014278;
    color: #ffffff;
}

/* File Upload */
.file-upload-area {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: rgba(255, 255, 255, 0.05);
}

.file-upload-area:hover {
    border-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 0 15px #a8498a3f;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-content {
    pointer-events: none;
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 15px;
    stroke: var(--color-accent);
    stroke-width: 2;
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.upload-text {
    font-size: 1rem;
    color: var(--color-white);
    margin-bottom: 5px;
    font-weight: 600;
}

.upload-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.file-preview-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
}

.file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-item .remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: var(--color-error);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Terms Box */
.terms-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.terms-box h4 {
    margin-bottom: 15px;
    color: var(--color-accent);
    font-size: 1.1rem;
}

.terms-content p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* Document Fields */
.document-field {
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

/* Error Messages */
.error-message {
    display: block;
    color: var(--color-error);
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 20px;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================================
   BUTTONS
   ============================================ */
.form-navigation {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
    color: var(--color-white);
    box-shadow: 0 4px 15px #a8498a54;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px #a8498a7a;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn span {
    font-size: 1.2rem;
}

.btn:disabled,
.btn[disabled] {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: auto;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.4s ease;
    border: 2px solid var(--color-accent);
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
}

.success-icon {
    background: var(--color-success);
    color: white;
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--color-white);
}

.modal-content p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
    line-height: 1.6;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .form-wrapper {
        padding: 20px 15px;
    }
    
    .logo-smart {
        font-size: 2rem;
    }
    
    .logo-brasil {
        font-size: 1.2rem;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .step-title {
        font-size: 1.3rem;
    }
    
    .form-navigation {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(1, 66, 120, 0.3);
    border-radius: 50%;
    border-top-color: var(--color-accent);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Shake Animation */
.error-shake {
    animation: shake 0.3s ease;
}
