:root {
    --app-font-family: "Yekan Bakh", Tahoma, Arial, sans-serif;
    --bs-font-sans-serif: var(--app-font-family);
    --bs-body-font-family: var(--app-font-family);
    --brand-950: #073b3a;
    --brand-900: #0b4f4c;
    --brand-800: #0f625e;
    --brand-700: #0f766e;
    --brand-600: #0d9488;
    --brand-100: #ccfbf1;
    --brand-50: #f0fdfa;
    --ink-900: #172322;
    --ink-700: #3c4d4b;
    --ink-500: #687b78;
    --surface: #ffffff;
    --surface-muted: #f4f8f7;
    --border: #dce7e5;
    --danger: #c2413a;
    --danger-soft: #fff3f2;
    --success: #15803d;
    --shadow: 0 24px 70px rgba(8, 65, 61, .10);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 11px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--app-font-family);
    color: var(--ink-900);
    background: #eef6f4;
    text-rendering: optimizeLegibility;
}

body { min-width: 320px; }
button, input, select, textarea { font: inherit; }
a { color: var(--brand-700); text-decoration: none; }
.app-shell { min-height: 100vh; }

.registration-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 10%, rgba(13, 148, 136, .10), transparent 27rem),
        radial-gradient(circle at 93% 32%, rgba(20, 184, 166, .08), transparent 25rem),
        linear-gradient(180deg, #f8fbfa 0, #edf6f4 100%);
}

.registration-page::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: 0;
    opacity: .24;
    background-image: radial-gradient(#6ba49e 0.7px, transparent 0.7px);
    background-size: 20px 20px;
    mask-image: linear-gradient(to bottom, black, transparent 65%);
}

.registration-header {
    width: 100%;
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink-900); }
.brand:hover { color: var(--ink-900); }
.brand-mark {
    width: 46px; height: 46px; border-radius: 15px;
    display: grid; place-items: center;
    color: white; font-size: 30px; line-height: 1; font-weight: 300;
    background: linear-gradient(145deg, var(--brand-600), var(--brand-900));
    box-shadow: 0 10px 24px rgba(15, 118, 110, .24);
}
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 18px; letter-spacing: -.3px; }
.brand small { color: var(--ink-500); font-size: 11px; margin-top: 1px; }

.registration-container { width: min(100% - 32px, 860px); margin: 22px auto 46px; flex: 1; }
.registration-footer { text-align: center; color: var(--ink-500); font-size: 12px; padding: 18px 16px 26px; }

.login-card, .step-card, .progress-panel, .state-card {
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(202, 220, 216, .9);
    box-shadow: var(--shadow);
}

.login-card {
    display: grid;
    grid-template-columns: minmax(250px, .8fr) minmax(360px, 1.2fr);
    border-radius: 30px;
    overflow: hidden;
    min-height: 530px;
}

.login-visual {
    position: relative;
    min-height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 38px;
    overflow: hidden;
    color: white;
    background: linear-gradient(150deg, #063f3d, #0f766e 65%, #14a596);
}
.login-visual::before, .login-visual::after {
    content: ""; position: absolute; border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.login-visual::before { width: 210px; height: 210px; left: -80px; top: -60px; }
.login-visual::after { width: 170px; height: 170px; right: -70px; bottom: 60px; }
.medical-orbit { position: absolute; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.orbit-one { width: 250px; height: 250px; top: 50px; right: -30px; }
.orbit-two { width: 170px; height: 170px; top: 90px; right: 10px; border-style: dashed; }
.medical-badge {
    position: absolute; top: 135px; right: 76px;
    width: 68px; height: 68px; border-radius: 22px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.94); color: var(--brand-700); font-size: 45px; font-weight: 200;
    box-shadow: 0 18px 40px rgba(0,0,0,.16);
}
.visual-copy { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.visual-copy strong { font-size: 23px; }
.visual-copy span { color: rgba(255,255,255,.77); line-height: 1.9; font-size: 13px; }
.login-form-panel { padding: 64px 58px; display: flex; flex-direction: column; justify-content: center; }

.eyebrow { display: block; color: var(--brand-700); font-size: 12px; font-weight: 800; margin-bottom: 7px; }
h1 { font-size: clamp(24px, 4vw, 31px); line-height: 1.45; letter-spacing: -.7px; margin: 0; font-weight: 850; }
.step-description, .step-intro p { color: var(--ink-500); line-height: 1.9; font-size: 14px; margin: 9px 0 24px; }

.step-card { border-radius: var(--radius-lg); padding: 38px 44px 42px; }
.step-intro { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 8px; }
.step-number {
    flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center;
    border-radius: 14px; background: var(--brand-50); color: var(--brand-700); font-weight: 900;
    border: 1px solid #b9e8e1;
}
.step-intro > div { flex: 1; }
.step-intro h1 { font-size: 25px; }
.step-intro p { margin-bottom: 18px; }

.progress-panel { border-radius: 19px; padding: 18px 22px 16px; margin-bottom: 14px; box-shadow: 0 12px 36px rgba(8,65,61,.06); }
.progress-copy { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.progress-copy > div { display: flex; align-items: center; gap: 9px; }
.progress-copy .eyebrow { margin: 0; font-weight: 600; color: var(--ink-500); }
.progress-copy strong { font-size: 13px; }
.progress-percent { color: var(--brand-700); font-weight: 900; font-size: 15px; direction: rtl; }
.registration-progress { height: 7px; border-radius: 20px; background: #e4efed; overflow: visible; }
.registration-progress .progress-bar { border-radius: 20px; background: linear-gradient(90deg, var(--brand-600), var(--brand-800)); transition: width .45s ease; }
.step-dots { display: flex; justify-content: space-between; gap: 8px; margin-top: 15px; }
.step-dot { position: relative; display: flex; align-items: center; gap: 6px; color: #91a19f; font-size: 10px; white-space: nowrap; }
.step-dot i { width: 8px; height: 8px; border-radius: 50%; background: #c8d5d3; }
.step-dot.active { color: var(--brand-800); font-weight: 800; }
.step-dot.active i { background: white; border: 2px solid var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
.step-dot.done { color: var(--ink-500); }
.step-dot.done i { background: var(--brand-600); }

.form-section { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 26px; }
.form-grid { display: grid; gap: 19px; margin-bottom: 24px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }
.form-field { min-width: 0; }
.form-field label { display: block; font-size: 13px; font-weight: 750; margin-bottom: 8px; color: var(--ink-700); }
.form-field label small { color: var(--ink-500); font-weight: 400; }
.form-control, .form-select {
    min-height: 48px; border-radius: var(--radius-sm); border-color: var(--border);
    padding: 10px 13px; color: var(--ink-900); background-color: #fbfdfc;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-control::placeholder { color: #a1afad; font-size: 13px; }
.form-control:focus, .form-select:focus {
    border-color: var(--brand-600); background: white;
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
textarea.form-control { resize: vertical; }
.validation-message { display: block; color: var(--danger); font-size: 11px; margin-top: 6px; }
.field-hint { display: block; color: var(--ink-500); font-size: 10px; line-height: 1.7; margin-top: 6px; }
.field-label-row { display: flex; justify-content: space-between; align-items: center; }

.input-with-prefix, .input-with-suffix, .iban-input { display: flex; direction: ltr; }
.input-with-prefix > span, .input-with-suffix > span, .iban-input > span {
    min-width: 55px; display: grid; place-items: center;
    color: var(--ink-500); font-size: 12px; background: var(--surface-muted); border: 1px solid var(--border);
}
.input-with-prefix > span, .iban-input > span { border-radius: 11px 0 0 11px; border-right: 0; }
.input-with-prefix .form-control, .iban-input .form-control { border-radius: 0 11px 11px 0; }
.input-with-suffix > span { border-radius: 0 11px 11px 0; border-left: 0; min-width: 62px; }
.input-with-suffix .form-control { border-radius: 11px 0 0 11px; }
.otp-field { margin-top: 16px; }
.otp-input { direction: ltr; text-align: center; letter-spacing: 9px; font-size: 21px; font-weight: 800; }

.btn { border-radius: 11px; font-weight: 750; }
.btn-lg { min-height: 50px; font-size: 14px; }
.btn-brand { color: white; border-color: var(--brand-700); background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); box-shadow: 0 10px 24px rgba(15,118,110,.19); }
.btn-brand:hover, .btn-brand:focus { color: white; background: linear-gradient(135deg, var(--brand-700), var(--brand-900)); border-color: var(--brand-800); }
.btn-brand:disabled { color: white; opacity: .62; }
.btn-outline-brand { color: var(--brand-700); border-color: #9ed5cf; background: white; }
.btn-outline-brand:hover { color: white; background: var(--brand-700); border-color: var(--brand-700); }
.btn-ghost { color: var(--ink-700); background: rgba(255,255,255,.65); border: 1px solid var(--border); }
.btn-link-clean { padding: 0; border: 0; background: none; color: var(--brand-700); font-size: 11px; }
.privacy-note { color: var(--ink-500); text-align: center; font-size: 10px; line-height: 1.8; margin: 16px 0 0; }

.inline-alert { display: flex; align-items: flex-start; gap: 9px; border-radius: 11px; padding: 11px 13px; margin-bottom: 18px; font-size: 12px; line-height: 1.7; }
.inline-alert > span:first-child { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; flex: 0 0 auto; font-weight: 900; }
.inline-alert-error { color: #8f2823; background: var(--danger-soft); border: 1px solid #f5cfcc; }
.inline-alert-error > span:first-child { color: white; background: var(--danger); }
.inline-alert-success { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.inline-alert-success > span:first-child { color: white; background: var(--success); }

.state-card { border-radius: var(--radius-lg); padding: 30px; display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 170px; }
.state-card strong { display: block; font-size: 16px; margin-bottom: 5px; }
.state-card p { margin: 0; color: var(--ink-500); font-size: 12px; }
.state-card-error { justify-content: flex-start; }
.state-icon { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: white; background: var(--danger); font-weight: 900; }
.text-brand { color: var(--brand-700) !important; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin: 8px 0 24px; }
.choice-card {
    position: relative; border: 1px solid var(--border); background: #fbfdfc; border-radius: 16px;
    padding: 20px; min-height: 145px; display: flex; flex-direction: column; align-items: flex-start;
    text-align: right; color: var(--ink-900); transition: transform .2s, border-color .2s, box-shadow .2s, background .2s;
}
.choice-card:hover { transform: translateY(-2px); border-color: #9acdc7; box-shadow: 0 10px 24px rgba(8,65,61,.07); }
.choice-card.selected { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 2px rgba(13,148,136,.10); }
.choice-card strong { font-size: 14px; margin: 12px 0 5px; }
.choice-card small { color: var(--ink-500); font-size: 10px; line-height: 1.7; }
.choice-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--brand-800); background: #d9f4ef; font-weight: 900; }
.radio-indicator { position: absolute; top: 17px; left: 17px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #bac9c7; }
.choice-card.selected .radio-indicator { border: 5px solid var(--brand-600); background: white; }
.choice-card.horizontal { min-height: 115px; flex-direction: row; align-items: center; gap: 14px; }
.choice-card.horizontal strong { display: block; margin: 0 0 5px; }
.choice-card.horizontal > span:nth-child(2) { padding-left: 20px; }

.info-strip { display: flex; align-items: flex-start; gap: 10px; color: #315e5a; background: #f0f9f7; border: 1px solid #cee9e5; border-radius: 12px; padding: 12px 14px; font-size: 11px; line-height: 1.8; margin: 0 0 22px; }
.info-strip > span, .completion-note > span { flex: 0 0 auto; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--brand-600); font-weight: 900; }
.file-selected { display: flex; align-items: center; gap: 8px; color: var(--success); font-size: 11px; margin: -10px 0 20px; }
.file-selected span { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--success); }

.optional-section { border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin: 0 0 24px; background: #fbfdfc; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; cursor: pointer; margin: 0; }
.toggle-row span { display: flex; flex-direction: column; }
.toggle-row strong { font-size: 13px; }
.toggle-row small { color: var(--ink-500); font-size: 10px; margin-top: 4px; }
.toggle-row .form-check-input { width: 2.5em; height: 1.25em; flex: 0 0 auto; }
.toggle-row .form-check-input:checked { background-color: var(--brand-600); border-color: var(--brand-600); }
.neshan-map { height: 320px; border-radius: 12px; overflow: hidden; margin-top: 16px; background: #dce9e7; }
.map-placeholder { min-height: 180px; display: grid; place-items: center; text-align: center; border-radius: 12px; margin-top: 16px; padding: 24px; color: var(--ink-700); background: linear-gradient(135deg, #e5f2ef, #f6faf9); border: 1px dashed #a8cbc6; }
.map-placeholder strong { font-size: 13px; }
.map-placeholder p { max-width: 410px; color: var(--ink-500); font-size: 10px; line-height: 1.8; margin: 5px 0; }
.map-pin { font-size: 30px; color: var(--brand-700); }

.confirmation-panel { display: flex; gap: 13px; align-items: center; padding: 17px; margin-bottom: 20px; border: 1px solid #bce5df; border-radius: 15px; background: var(--brand-50); }
.confirmation-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--brand-600); }
.confirmation-panel strong { display: block; font-size: 13px; }
.confirmation-panel p { color: var(--ink-500); font-size: 10px; margin: 4px 0 0; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 14px; }
.section-title-row > div { display: flex; flex-direction: column; }
.section-title-row strong { font-size: 14px; }
.section-title-row small { color: var(--ink-500); font-size: 10px; margin-top: 3px; }
.tariff-row { border: 1px solid var(--border); border-radius: 15px; padding: 16px; margin-bottom: 13px; background: #fbfdfc; }
.tariff-row-header { display: flex; justify-content: space-between; color: var(--brand-800); font-size: 11px; font-weight: 800; margin-bottom: 13px; }
.remove-button { width: 25px; height: 25px; border: 0; border-radius: 8px; color: var(--danger); background: var(--danger-soft); font-size: 18px; line-height: 1; }
.tariff-grid { grid-template-columns: 1.2fr .8fr; margin: 0; gap: 13px; }

.review-list { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin: 8px 0 22px; }
.review-item { display: flex; align-items: center; gap: 12px; padding: 15px 17px; background: #fbfdfc; border-bottom: 1px solid var(--border); }
.review-item:last-child { border-bottom: 0; }
.review-item > span { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--brand-600); }
.review-item div { display: flex; flex-direction: column; }
.review-item strong { font-size: 12px; }
.review-item small { color: var(--ink-500); font-size: 10px; margin-top: 3px; }
.final-consent { display: flex; align-items: center; gap: 9px; cursor: pointer; color: var(--ink-700); font-size: 12px; margin-bottom: 18px; }
.final-consent .form-check-input:checked { background-color: var(--brand-600); border-color: var(--brand-600); }

.completed-state { text-align: center; padding: 28px 18px 18px; }
.success-rings { width: 108px; height: 108px; margin: 0 auto 24px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-50); box-shadow: 0 0 0 12px rgba(204,251,241,.45), 0 0 0 23px rgba(204,251,241,.2); }
.success-rings span { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; color: white; background: linear-gradient(145deg, var(--brand-600), var(--brand-800)); font-size: 30px; }
.completed-state h1 { max-width: 540px; margin: 4px auto 10px; }
.completed-state > p { max-width: 610px; margin: 0 auto 24px; color: var(--ink-500); line-height: 2; font-size: 13px; }
.completion-note { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 9px; text-align: right; color: var(--ink-700); background: var(--surface-muted); border: 1px solid var(--border); border-radius: 12px; padding: 12px; font-size: 11px; }

.fade-in { animation: fade-in .28s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

#blazor-error-ui { color-scheme: light; background: #fff4d7; bottom: 0; box-shadow: 0 -1px 6px rgba(0,0,0,.16); display: none; left: 0; padding: .8rem 1.25rem; position: fixed; width: 100%; z-index: 1000; font-size: 12px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: auto; left: .75rem; top: .5rem; }
.blazor-error-boundary { background: var(--danger); padding: 1rem; color: white; border-radius: 12px; }
.blazor-error-boundary::after { content: "خطایی در نمایش این بخش رخ داد."; }

@media (max-width: 767.98px) {
    .registration-header { min-height: 72px; padding-inline: 18px; }
    .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
    .brand strong { font-size: 15px; }
    .brand small { display: none; }
    .registration-container { width: min(100% - 20px, 620px); margin-top: 10px; }
    .login-card { grid-template-columns: 1fr; min-height: 0; border-radius: 22px; }
    .login-visual { min-height: 155px; padding: 25px; }
    .medical-orbit { display: none; }
    .medical-badge { top: 26px; left: 28px; right: auto; width: 52px; height: 52px; border-radius: 17px; font-size: 35px; }
    .visual-copy strong { font-size: 18px; }
    .visual-copy span { max-width: 75%; }
    .login-form-panel { padding: 33px 25px 30px; }
    .step-card { border-radius: 20px; padding: 27px 21px 29px; }
    .progress-panel { padding-inline: 17px; }
    .step-dots { overflow-x: auto; padding-bottom: 3px; }
    .step-dot { font-size: 9px; }
    .step-intro { gap: 11px; }
    .step-number { width: 37px; height: 37px; border-radius: 12px; }
    .step-intro h1 { font-size: 21px; }
    .choice-grid, .form-grid.two-columns, .tariff-grid { grid-template-columns: 1fr; }
    .field-span-2 { grid-column: auto; }
    .choice-card { min-height: 125px; }
    .choice-card.horizontal { min-height: 105px; }
    .neshan-map { height: 260px; }
}

@media (max-width: 420px) {
    .progress-copy > div .eyebrow { display: none; }
    .visual-copy span { font-size: 11px; }
    .registration-footer { font-size: 10px; }
    .choice-card.horizontal { padding: 15px; gap: 10px; }
    .choice-card.horizontal .choice-icon { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
