/* ============================================================
   Portal das Finanças - Custom Styles
   ============================================================ */

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: hsl(215 25% 22%);
}

/* ============================================================
   Form Field States
   ============================================================ */
input, select, textarea {
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input:hover:not(:disabled),
select:hover:not(:disabled) {
    border-color: hsl(214 30% 65%);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
    outline: none;
    border-color: hsl(214 60% 50%) !important;
    box-shadow: 0 0 0 3px hsl(214 60% 50% / 0.15);
}

.field-valid {
    border-color: hsl(142 70% 45%) !important;
    background-color: hsl(142 70% 98%);
}

.field-valid:focus {
    box-shadow: 0 0 0 3px hsl(142 70% 45% / 0.15) !important;
}

.field-invalid {
    border-color: hsl(0 75% 55%) !important;
    background-color: hsl(0 75% 99%);
}

.field-invalid:focus {
    box-shadow: 0 0 0 3px hsl(0 75% 55% / 0.15) !important;
}

/* ============================================================
   Custom Select Dropdown
   ============================================================ */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 1.125rem;
    padding-right: 2.75rem !important;
    cursor: pointer;
}

select::-ms-expand { display: none; }
select option { padding: 8px; font-size: 0.9375rem; }

/* ============================================================
   Animations
   ============================================================ */
@keyframes scale-in {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fade-in {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-left {
    0% { opacity: 0; transform: translateX(-12px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes check-pop {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    60% { transform: scale(1.15) rotate(0deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes slide-down {
    0% { opacity: 0; transform: translateY(-8px); max-height: 0; }
    100% { opacity: 1; transform: translateY(0); max-height: 500px; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes progress-fill {
    from { width: 0%; }
}

.anim-scale-in { animation: scale-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.anim-check-pop { animation: check-pop 0.4s ease-out 0.2s both; }
.anim-fade-in { animation: fade-in 0.4s ease-out; }
.anim-fade-in-left { animation: fade-in-left 0.4s ease-out 0.3s both; }
.anim-slide-down { animation: slide-down 0.3s ease-out; overflow: hidden; }
.anim-shake { animation: shake 0.4s ease-in-out; }
.animate-pulse { animation: pulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-spin { animation: spin 0.8s linear infinite; }

/* Step content transition */
.step-content {
    animation: fade-in 0.35s ease-out;
}

/* ============================================================
   Step Indicator
   ============================================================ */
.step-circle {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-circle.is-active {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px hsl(214 60% 50% / 0.18);
}

.step-line {
    transition: background-color 0.4s ease;
}

.step-progress-bar {
    position: relative;
    height: 3px;
    background: hsl(214 15% 90%);
    border-radius: 2px;
    overflow: hidden;
}

.step-progress-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, hsl(214 60% 50%), hsl(195 65% 50%));
    transform-origin: left;
    transform: scaleX(var(--progress, 0));
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   Cards & Sections
   ============================================================ */
.form-card {
    background: white;
    border-radius: 16px;
    border: 1px solid hsl(214 15% 88%);
    box-shadow: 0 1px 3px hsl(214 25% 15% / 0.04), 0 4px 16px hsl(214 25% 15% / 0.04);
    overflow: hidden;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
    color: hsl(214 60% 32%);
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, hsl(214 15% 88%), transparent);
}

.section-divider-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: hsl(214 60% 95%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(214 60% 32%);
    flex-shrink: 0;
}

.intro-card {
    background: linear-gradient(135deg, hsl(214 60% 97%), hsl(195 65% 97%));
    border: 1px solid hsl(214 60% 88%);
    border-radius: 12px;
    padding: 1rem 1.125rem;
    color: hsl(214 60% 28%);
    font-size: 0.875rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.intro-card-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
    color: hsl(214 60% 45%);
}

.business-banner {
    background: linear-gradient(135deg, hsl(35 90% 96%), hsl(45 95% 96%));
    border: 1px solid hsl(35 80% 80%);
    border-radius: 12px;
    padding: 1rem 1.125rem;
    color: hsl(30 80% 30%);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

/* ============================================================
   Buttons
   ============================================================ */
button {
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary {
    background: hsl(214 60% 32%);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 1px 2px hsl(214 60% 20% / 0.1), 0 0 0 1px hsl(214 60% 25% / 0.1);
    transition: all 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
    background: hsl(214 60% 28%);
    box-shadow: 0 4px 12px hsl(214 60% 32% / 0.25);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px hsl(214 60% 20% / 0.1);
}

.btn-secondary {
    background: white;
    color: hsl(215 25% 22%);
    border: 1px solid hsl(214 15% 85%);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: hsl(214 15% 96%);
    border-color: hsl(214 15% 75%);
}

/* ============================================================
   Input Layout
   ============================================================ */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(215 25% 22%);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.field-icon {
    width: 14px;
    height: 14px;
    color: hsl(215 10% 50%);
    flex-shrink: 0;
}

.field-required { color: hsl(0 75% 55%); margin-left: 2px; }

.form-input,
.form-select {
    width: 100%;
    height: 44px;
    padding: 0 0.875rem;
    background: white;
    border: 1px solid hsl(214 15% 85%);
    border-radius: 10px;
    font-size: 0.9375rem;
    color: hsl(215 25% 22%);
}

.form-input::placeholder { color: hsl(215 10% 60%); }

.form-hint {
    font-size: 0.75rem;
    color: hsl(215 10% 50%);
    line-height: 1.4;
}

.form-error {
    font-size: 0.8125rem;
    color: hsl(0 75% 55%);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    line-height: 1.3;
    animation: fade-in 0.2s ease-out;
}

/* ============================================================
   Misc
   ============================================================ */
body.modal-open { overflow: hidden; }

.text-balance { text-wrap: balance; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: hsl(214 15% 96%); }
::-webkit-scrollbar-thumb { background: hsl(214 15% 80%); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: hsl(214 15% 70%); }

/* Selection */
::selection { background: hsl(214 60% 90%); color: hsl(214 60% 25%); }

