/* Theme-aware headings & body text — always follow MudBlazor palette */

.landing-shell h1,
.landing-shell h2,
.landing-shell h3,
.landing-shell h4,
.landing-shell h5,
.landing-shell h6,
.public-form-shell h1,
.public-form-shell h2,
.public-form-shell h3,
.public-form-shell h4,
.public-form-shell h5,
.public-form-shell h6,
.landing-shell .mud-typography-h1,
.landing-shell .mud-typography-h2,
.landing-shell .mud-typography-h3,
.landing-shell .mud-typography-h4,
.landing-shell .mud-typography-h5,
.landing-shell .mud-typography-h6,
.public-form-shell .mud-typography-h1,
.public-form-shell .mud-typography-h2,
.public-form-shell .mud-typography-h3,
.public-form-shell .mud-typography-h4,
.public-form-shell .mud-typography-h5,
.public-form-shell .mud-typography-h6,
.landing-shell .mud-typography-subtitle1,
.landing-shell .mud-typography-subtitle2,
.public-form-shell .mud-typography-subtitle1,
.public-form-shell .mud-typography-subtitle2,
.hcqm-page-header .mud-typography,
.hcqm-section .mud-typography-h1,
.hcqm-section .mud-typography-h2,
.hcqm-section .mud-typography-h3,
.hcqm-section .mud-typography-h4,
.hcqm-section .mud-typography-h5,
.hcqm-section .mud-typography-h6,
.hcqm-hero .mud-typography-h1,
.hcqm-hero .mud-typography-h2,
.hcqm-hero-title,
.hcqm-cta-band .mud-typography-h1,
.hcqm-cta-band .mud-typography-h2,
.hcqm-cta-band .mud-typography-h3,
.hcqm-cta-band .mud-typography-h4,
.hcqm-form-card .mud-typography-h5,
.hcqm-form-card .mud-typography-h6,
.hcqm-surface-card .mud-typography-h5,
.hcqm-surface-card .mud-typography-h6,
.hcqm-feature-card .mud-typography-h6,
.hcqm-section-title,
.landing-footer .mud-typography-h6,
.landing-footer .mud-typography-subtitle1 {
    color: var(--mud-palette-text-primary) !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    opacity: 1 !important;
    -webkit-text-fill-color: var(--mud-palette-text-primary);
}

.landing-shell .mud-typography-body1,
.landing-shell .mud-typography-body2,
.public-form-shell .mud-typography-body1,
.public-form-shell .mud-typography-body2,
.landing-shell p,
.public-form-shell p {
    color: var(--mud-palette-text-primary);
}

.landing-shell .mud-typography-h1,
.public-form-shell .mud-typography-h1,
.landing-shell h1,
.public-form-shell h1 {
    font-size: clamp(1.85rem, 4vw, 2.75rem) !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    margin-bottom: 0.75rem !important;
}

.landing-shell .mud-typography-h2,
.public-form-shell .mud-typography-h2,
.landing-shell h2,
.public-form-shell h2 {
    font-size: clamp(1.5rem, 3.2vw, 2.1rem) !important;
    line-height: 1.25 !important;
    margin-bottom: 0.65rem !important;
}

.landing-shell .mud-typography-h3,
.public-form-shell .mud-typography-h3,
.landing-shell h3,
.public-form-shell h3 {
    font-size: clamp(1.3rem, 2.6vw, 1.65rem) !important;
    line-height: 1.3 !important;
    margin-bottom: 0.55rem !important;
}

.landing-shell .mud-typography-h4,
.public-form-shell .mud-typography-h4,
.landing-shell h4,
.public-form-shell h4 {
    font-size: clamp(1.15rem, 2.2vw, 1.35rem) !important;
    line-height: 1.35 !important;
    margin-bottom: 0.5rem !important;
}

.landing-shell .mud-typography-h5,
.public-form-shell .mud-typography-h5,
.landing-shell h5,
.public-form-shell h5 {
    font-size: 1.15rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.4rem !important;
}

.landing-shell .mud-typography-h6,
.public-form-shell .mud-typography-h6,
.landing-shell h6,
.public-form-shell h6 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin-bottom: 0.35rem !important;
}

/* Defeat Bootstrap / MainTheme static heading colors */
.landing-shell .display-1,
.landing-shell .display-2,
.landing-shell .display-3,
.landing-shell .display-4,
.landing-shell .display-5,
.landing-shell .display-6,
.landing-shell .page-header h1,
.landing-shell .page-header h2 {
    color: var(--mud-palette-text-primary) !important;
    -webkit-text-fill-color: var(--mud-palette-text-primary);
}

/* Subtitles, leads, captions — secondary contrast */
.landing-shell .landing-muted,
.landing-shell .mud-typography-body1.landing-muted,
.landing-shell .mud-typography-body2.landing-muted,
.landing-shell .mud-typography-caption,
.landing-shell .hcqm-hero-lead,
.public-form-shell .landing-muted,
.public-form-shell .mud-typography-caption,
.hcqm-page-header .landing-muted,
.hcqm-cta-band .landing-muted,
.landing-footer .landing-muted,
.landing-footer .mud-typography-body2,
.landing-footer .mud-typography-caption {
    color: var(--mud-palette-text-secondary) !important;
    -webkit-text-fill-color: var(--mud-palette-text-secondary);
    font-weight: 400 !important;
}

[dir="rtl"].landing-shell h1,
[dir="rtl"].landing-shell h2,
[dir="rtl"].landing-shell h3,
[dir="rtl"].landing-shell h4,
[dir="rtl"].landing-shell h5,
[dir="rtl"].landing-shell h6,
.landing-shell[dir="rtl"] .mud-typography-h1,
.landing-shell[dir="rtl"] .mud-typography-h2,
.landing-shell[dir="rtl"] .mud-typography-h3,
.landing-shell[dir="rtl"] .mud-typography-h4,
.landing-shell[dir="rtl"] .mud-typography-h5,
.landing-shell[dir="rtl"] .mud-typography-h6 {
    text-align: inherit;
}

/* ========== RTL: MudBlazor input labels & floating labels ========== */
html[dir="rtl"] .mud-input-label,
html[dir="rtl"] .mud-input-label-inputcontrol,
html[dir="rtl"] .mud-input-label-input-control,
html[dir="rtl"] .mud-input-label.mud-input-label-inputcontrol,
[dir="rtl"] .mud-input-label,
[dir="rtl"] .mud-input-label-inputcontrol,
[dir="rtl"] .mud-input-label-input-control,
.landing-shell[dir="rtl"] .mud-input-label,
.landing-shell[dir="rtl"] .mud-input-label-inputcontrol,
.landing-shell[dir="rtl"] .mud-input-label-input-control,
.public-form-shell[dir="rtl"] .mud-input-label,
.public-form-shell[dir="rtl"] .mud-input-label-inputcontrol,
.public-form-shell[dir="rtl"] .mud-input-label-input-control,
.mud-application-layout-rtl .mud-input-label,
.mud-application-layout-rtl .mud-input-label-inputcontrol,
.mud-application-layout-rtl .mud-input-label-input-control {
    right: 14px !important;
    left: auto !important;
    text-align: right !important;
    transform-origin: top right !important;
}

html[dir="rtl"] .mud-input-label.mud-input-label-inputcontrol.mud-input-label-animated,
[dir="rtl"] .mud-input-label.mud-input-label-animated,
.landing-shell[dir="rtl"] .mud-input-label.mud-input-label-animated,
.public-form-shell[dir="rtl"] .mud-input-label.mud-input-label-animated {
    transform-origin: top right !important;
}

/* Outlined floating label notch / shrink position */
html[dir="rtl"] .mud-input.mud-input-outlined .mud-input-label.mud-input-label-inputcontrol,
[dir="rtl"] .mud-input.mud-input-outlined .mud-input-label,
.landing-shell[dir="rtl"] .mud-input-outlined .mud-input-label,
.public-form-shell[dir="rtl"] .mud-input-outlined .mud-input-label {
    right: 14px !important;
    left: auto !important;
    transform-origin: top right !important;
    text-align: right !important;
}

html[dir="rtl"] .mud-input > input,
html[dir="rtl"] .mud-input > textarea,
html[dir="rtl"] .mud-select .mud-select-input,
html[dir="rtl"] .mud-autocomplete .mud-input > input,
[dir="rtl"] .mud-input > input,
[dir="rtl"] .mud-input > textarea,
[dir="rtl"] .mud-select .mud-select-input,
.landing-shell[dir="rtl"] .mud-input > input,
.landing-shell[dir="rtl"] .mud-input > textarea,
.public-form-shell[dir="rtl"] .mud-input > input,
.public-form-shell[dir="rtl"] .mud-input > textarea {
    text-align: right !important;
    direction: rtl !important;
}

html[dir="rtl"] .mud-input-adornment-start,
[dir="rtl"] .mud-input-adornment-start,
.landing-shell[dir="rtl"] .mud-input-adornment-start,
.public-form-shell[dir="rtl"] .mud-input-adornment-start {
    margin-left: 8px !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .mud-input-adornment-end,
[dir="rtl"] .mud-input-adornment-end,
.landing-shell[dir="rtl"] .mud-input-adornment-end,
.public-form-shell[dir="rtl"] .mud-input-adornment-end {
    margin-right: 8px !important;
    margin-left: 0 !important;
}

/* Helper / error text under fields */
html[dir="rtl"] .mud-input-helper-text,
html[dir="rtl"] .mud-input-error,
[dir="rtl"] .mud-input-helper-text,
.landing-shell[dir="rtl"] .mud-input-helper-text,
.public-form-shell[dir="rtl"] .mud-input-helper-text {
    text-align: right !important;
    direction: rtl !important;
}

/* ========== RTL: Steppers & form wizards ========== */
html[dir="rtl"] .mud-stepper,
html[dir="rtl"] .mud-stepper .mud-stepper-nav,
[dir="rtl"] .mud-stepper,
[dir="rtl"] .mud-stepper .mud-stepper-nav,
.landing-shell[dir="rtl"] .mud-stepper,
.public-form-shell[dir="rtl"] .mud-stepper {
    direction: rtl !important;
}

html[dir="rtl"] .mud-stepper .mud-stepper-nav,
[dir="rtl"] .mud-stepper .mud-stepper-nav,
.landing-shell[dir="rtl"] .mud-stepper-nav,
.public-form-shell[dir="rtl"] .mud-stepper-nav {
    flex-direction: row-reverse !important;
}

html[dir="rtl"] .mud-step-header,
html[dir="rtl"] .mud-step,
[dir="rtl"] .mud-step-header,
[dir="rtl"] .mud-step,
.landing-shell[dir="rtl"] .mud-step-header,
.public-form-shell[dir="rtl"] .mud-step-header {
    flex-direction: row-reverse !important;
    direction: rtl !important;
}

html[dir="rtl"] .mud-stepper .mud-stepper-nav .mud-button-root,
[dir="rtl"] .mud-stepper .mud-stepper-nav .mud-button-root {
    flex-direction: row-reverse !important;
}

/* Connector lines between steps — mirror for RTL */
html[dir="rtl"] .mud-stepper .mud-stepper-nav .mud-stepper-nav-connector,
[dir="rtl"] .mud-stepper .mud-stepper-nav-connector,
.landing-shell[dir="rtl"] .mud-stepper-nav-connector,
.public-form-shell[dir="rtl"] .mud-stepper-nav-connector {
    transform: scaleX(-1);
}

/* Custom wizard progress + actions (MudCard form wizards) */
.landing-shell[dir="rtl"] .mud-progress-linear,
.public-form-shell[dir="rtl"] .mud-progress-linear,
html[dir="rtl"] .hcqm-form-card .mud-progress-linear,
[dir="rtl"] .hcqm-form-card .mud-progress-linear {
    direction: rtl !important;
    transform: scaleX(-1);
}

.landing-shell[dir="rtl"] .mud-progress-linear .mud-progress-linear-bar,
.public-form-shell[dir="rtl"] .mud-progress-linear .mud-progress-linear-bar,
[dir="rtl"] .hcqm-form-card .mud-progress-linear-bar {
    transform: scaleX(-1);
}

/* Prev (السابق) on the right, Next/Submit (التالي) on the left */
html[dir="rtl"] .mud-card-actions.justify-space-between,
[dir="rtl"] .mud-card-actions.justify-space-between,
.landing-shell[dir="rtl"] .mud-card-actions.justify-space-between,
.public-form-shell[dir="rtl"] .mud-card-actions.justify-space-between,
.landing-shell[dir="rtl"] .hcqm-form-card .mud-card-actions,
.public-form-shell[dir="rtl"] .hcqm-form-card .mud-card-actions {
    display: flex !important;
    flex-direction: row-reverse !important;
    justify-content: space-between !important;
    direction: rtl !important;
    gap: 0.75rem;
}

html[dir="rtl"] .mud-card-actions.justify-end,
[dir="rtl"] .mud-card-actions.justify-end,
.public-form-shell[dir="rtl"] .mud-card-actions.justify-end {
    justify-content: flex-start !important;
    direction: rtl !important;
}

/* Wizard step caption stays readable RTL */
.public-form-shell[dir="rtl"] .hcqm-form-card,
.landing-shell[dir="rtl"] .hcqm-form-card {
    direction: rtl;
    text-align: right;
}

/* Language toggle: keep outer corners rounded in LTR and RTL (Mud uses physical radii) */
.lang-switcher-group.mud-button-group,
.lang-switcher .mud-button-group {
    border-radius: 8px !important;
    overflow: hidden;
}

.lang-switcher-group .mud-button-root:first-of-type,
.lang-switcher .mud-button-group > .mud-button-root:first-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-start-start-radius: 8px !important;
    border-end-start-radius: 8px !important;
    border-start-end-radius: 0 !important;
    border-end-end-radius: 0 !important;
}

.lang-switcher-group .mud-button-root:last-of-type,
.lang-switcher .mud-button-group > .mud-button-root:last-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-start-end-radius: 8px !important;
    border-end-end-radius: 8px !important;
    border-start-start-radius: 0 !important;
    border-end-start-radius: 0 !important;
}

