/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #205560;
    --primary-hover: #1a454e;
    --primary-light: #e8f2f4;
    --secondary: #90bbc2;
    --success: #10B981;
    --error: #EF4444;
    --text: #1F2937;
    --text-light: #6B7280;
    --border: #E5E7EB;
    --bg: #FFFFFF;
    --bg-light: #FFFFFF;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* === Container === */
#app {
    max-width: 720px;
    margin: 0 auto;
    padding: 0;
}

#app.layout-full {
    max-width: 100%;
}

.wizard-container {
    background: var(--bg);
    border-radius: 12px;
    box-shadow: none;
    padding: 40px;
    position: relative;
}

.layout-full .wizard-container {
    border-radius: 0;
}

@media (max-width: 640px) {
    .wizard-container {
        padding: 24px 20px;
    }
}

/* === Progress Bar === */
.progress-bar {
    margin-bottom: 32px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 4px;
}

.progress-step {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    text-align: center;
    flex: 1;
    padding: 4px 2px;
    transition: color var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-step.active {
    color: var(--primary);
    font-weight: 600;
}

.progress-step.completed {
    color: var(--secondary);
}

.progress-track {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.4s ease;
}

/* === Typography === */
h1, h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
}

.subtitle {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 28px;
}

/* === Form === */
.form-group {
    margin-bottom: 20px;
}

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

@media (max-width: 540px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.required {
    color: var(--error);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(32, 85, 96, 0.1);
}

input.error,
select.error,
textarea.error {
    border-color: var(--error);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* === Floating Label System === */
.form-group.floating {
    position: relative;
}

.form-group.floating input[type="text"],
.form-group.floating input[type="email"],
.form-group.floating input[type="tel"],
.form-group.floating input[type="number"],
.form-group.floating input[type="url"],
.form-group.floating textarea {
    padding: 22px 14px 8px;
}

.form-group.floating select {
    padding: 22px 36px 8px 14px;
}

.form-group.floating select:invalid {
    color: transparent;
}

.form-group.floating select:invalid option {
    color: var(--text);
}

.form-group.floating > label {
    position: absolute;
    top: 16px;
    left: 14px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-light);
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                font-size 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0;
    line-height: 1;
    z-index: 1;
}

.form-group.floating input:focus + label,
.form-group.floating input:not(:placeholder-shown) + label,
.form-group.floating textarea:focus + label,
.form-group.floating textarea:not(:placeholder-shown) + label {
    transform: translateY(-10px);
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
}

.form-group.floating input:not(:focus):not(:placeholder-shown) + label,
.form-group.floating textarea:not(:focus):not(:placeholder-shown) + label {
    color: var(--text-light);
}

.form-group.floating select:focus + label,
.form-group.floating.has-value select + label {
    transform: translateY(-10px);
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
}

.form-group.floating.has-value select:not(:focus) + label {
    color: var(--text-light);
}

.form-group.floating input:-webkit-autofill + label {
    transform: translateY(-10px);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-light);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0px 1000px var(--bg) inset;
    transition: background-color 5000s ease-in-out 0s;
}

.form-group.floating input.error + label,
.form-group.floating select.error + label,
.form-group.floating textarea.error + label {
    color: var(--error);
}

/* === Select Group === */
.select-group {
    background: var(--primary-light);
    border-radius: calc(var(--radius) + 4px);
    padding: 20px;
    margin-bottom: 20px;
}

.select-group .form-group:last-of-type {
    margin-bottom: 0;
}

.select-group-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.select-group .form-group.floating select {
    background: var(--bg);
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.field-hint {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 6px;
    margin-bottom: 0;
    line-height: 1.5;
}

.field-error {
    color: var(--error);
    font-size: 13px;
    margin-top: 4px;
    min-height: 0;
}

/* === Hide reCAPTCHA badge === */
.grecaptcha-badge {
    visibility: hidden !important;
}

/* === Radio & Checkbox groups === */
.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.option-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin: 0;
    margin-top: 1px;
    accent-color: var(--primary);
    cursor: pointer;
}

.option-group .option-item label {
    display: inline;
    margin: 0;
    margin-bottom: 0;
    padding: 0;
    cursor: pointer;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

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

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-light);
    color: var(--text);
}

.wizard-nav {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.wizard-nav .btn {
    flex: 1;
}

/* === Spinner === */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.7s linear infinite;
}

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

#loaderMessage {
    transition: opacity 0.2s ease;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* === Loading overlay === */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.loading-overlay .spinner {
    width: 36px;
    height: 36px;
    border-color: rgba(32, 85, 96, 0.2);
    border-top-color: var(--primary);
    border-width: 3px;
}

.loading-overlay p {
    margin-top: 16px;
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
}

/* === Step === */
.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* === Confirmation === */
.confirmation {
    text-align: center;
    padding: 40px 20px;
}

.confirmation-icon {
    width: 64px;
    height: 64px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
}

.confirmation h2 {
    margin-bottom: 12px;
}

.confirmation p {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 28px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.confirmation .btn {
    width: auto;
}

/* === Global error === */
.global-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: var(--error);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-top: 16px;
}

/* === Wizard question === */
.wizard-question {
    margin-bottom: 24px;
}

.wizard-question label {
    font-size: 15px;
    margin-bottom: 8px;
}
