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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #16a34a;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --card: #ffffff;
    --step-done: #16a34a;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

body {
    font-family: "Inter", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
header .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Layout ── */
main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.wizard-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 680px;
    overflow: hidden;
    animation: fadeUp 0.35s ease;
    margin: 0 auto;
}

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

/* ── Progress bar ── */
.progress-header {
    background: linear-gradient(135deg, #1c315f, #2563eb);
    padding: 2rem 2rem 0;
}
.progress-header h1 {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.steps-bar {
    display: flex;
    gap: 0;
    position: relative;
}
.steps-bar::before {
    content: "";
    position: absolute;
    top: 19px;
    left: calc(12.5%);
    width: 75%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 0;
}
.step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding-bottom: 1.2rem;
    position: relative;
    z-index: 1;
    cursor: default;
}
.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    transition: all 0.3s;
}
.step-item.completed .step-circle {
    background: var(--step-done);
    border-color: var(--step-done);
    color: #fff;
}
.step-item.active .step-circle {
    background: #fff;
    border-color: #fff;
    color: var(--primary);
}
.step-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-align: center;
    transition: color 0.3s;
}
.step-item.active .step-label,
.step-item.completed .step-label {
    color: #fff;
}

/* ── Form Body ── */
.form-body {
    padding: 2rem;
}
.step-panel {
    display: none;
}
.step-panel.active {
    display: block;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.step-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.step-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ── Fields ── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-grid .full {
    grid-column: 1 / -1;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}
label .req {
    color: var(--danger);
    margin-left: 2px;
}

.input-wrap {
    position: relative;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 0.65rem 0.65rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--card);
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
input.error,
select.error {
    border-color: var(--danger);
    background: var(--danger-light);
}
.phone-group {
    display: flex;
    gap: 0.5rem;
}
.phone-code {
    width: 90px;
    flex-shrink: 0;
}

.field-error {
    font-size: 0.75rem;
    color: var(--danger);
    min-height: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.field-error::before {
    content: "⚠ ";
}
.field-error:empty::before {
    content: "";
}

/* custom select arrow */
.select-wrapper {
    position: relative;
}
.select-wrapper::after {
    content: "▾";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ── Profession Radio ── */
.profession-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}
.profession-card {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background 0.2s,
        transform 0.15s;
    position: relative;
}
.profession-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.profession-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.profession-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.profession-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.profession-card .title {
    font-weight: 700;
    font-size: 0.95rem;
}
.profession-card .sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}
.profession-card .check {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: transparent;
    background: #fff;
    transition: all 0.2s;
}
.profession-card.selected .check {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Terms Checkbox ── */
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background 0.2s;
}
.checkbox-row:hover {
    border-color: var(--primary);
}
.checkbox-row.checked {
    border-color: var(--primary);
    background: var(--primary-light);
}
.checkbox-row input[type="checkbox"] {
    display: none;
}
.checkbox-box {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: transparent;
    background: #fff;
    transition: all 0.2s;
}
.checkbox-row.checked .checkbox-box {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.checkbox-label {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.4;
}
.checkbox-label a {
    color: var(--primary);
    text-decoration: none;
}
.checkbox-label a:hover {
    text-decoration: underline;
}

/* ── Navigation ── */
.form-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}
.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.register-bg{
    width: 100%;
    height: 100%;
    padding: 2rem 1rem 4rem;
}
.btn-primary {
    background: #00bde0;
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg);
}
.btn-secondary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Banner error ── */
.banner-error {
    display: none;
    background: var(--danger-light);
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--danger);
    margin-bottom: 1rem;
}
.banner-error.visible {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ── Success overlay ── */
.success-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeIn 0.4s ease;
}
.success-overlay.visible {
    display: flex;
}
.success-icon {
    width: 72px;
    height: 72px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.25rem;
}
.success-overlay h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}
.success-overlay p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 380px;
    line-height: 1.5;
}

/* ── Loader spinner ── */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}
.btn.loading .spinner {
    display: inline-block;
}
.btn.loading .btn-text {
    opacity: 0.7;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .profession-grid {
        grid-template-columns: 1fr;
    }
    .form-body {
        padding: 1.25rem;
    }
    .progress-header {
        padding: 1.5rem 1.25rem 0;
    }
    main {
        padding: 1rem 0.5rem 3rem;
    }
}
