:root {
    --color-bg: #fff;
    --color-bg-header: #F1F4F7;
    --color-fg: #3730a3;
    --color-fg-contrast: #0f1013;
    --color-accent: #818cf8;
    --color-accent-hover: #4a84bf;
    --color-accent-secondary: #818cf8;
    --color-primary-red: #E6352B;
}

.page-container {
    margin: 0 auto;
    width: 100%;
    max-width: min(94vw, 1400px);
}

*:not(svg, svg *) {
    font-family: 'Inter', sans-serif;
    color: inherit;
}

body {
    color: var(--color-fg);
}

html {
    scroll-behavior: smooth;
}

.font-title,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins';
}

html[lang="ru"] .font-title,
html[lang="ru"] h1,
html[lang="ru"] h2,
html[lang="ru"] h3,
html[lang="ru"] h4,
html[lang="ru"] h5,
html[lang="ru"] h6 {
    font-family: 'Montserrat', sans-serif;
}

.decor-linear-bg {
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(255, 255, 255, 0.9)),
        var(--decor-bg) center / cover no-repeat;
}

.article img {
    border-radius: 24px;
    width: 100%;
    object-fit: contain;
}

.article li {
    list-style-type: disc;
    list-style-position: inside;
}

.article p {
    font-size: 15px;
}

.article a {
    color: #818cf8;
}

/* Prose styling for blog content */
.prose {
    color: var(--color-fg);
    line-height: 1.7;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose p {
    margin-bottom: 1rem;
}

.prose ul, .prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.prose ul li {
    list-style-type: disc;
}

.prose ol li {
    list-style-type: decimal;
}

.prose a {
    color: var(--color-accent);
    text-decoration: underline;
}

.prose img {
    border-radius: 0.75rem;
    margin: 1.5rem 0;
}

.prose blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: 1rem;
    font-style: italic;
    margin: 1.5rem 0;
}

/* Accordion */
.accordion {
    --acc-line: #E6EAF0;
    color: var(--color-fg);
}

.accordion-item {
    border-top: 1px solid var(--acc-line);
}

.accordion-item:last-child {
    border-bottom: 1px solid var(--acc-line);
}

.accordion-item.is-open {
    border-top-color: var(--color-fg);
}

.accordion-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 18px;
    border: 0;
    background: transparent;
    color: var(--color-fg);
    cursor: pointer;
    text-align: left;
}

.accordion-title {
    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
}

.accordion-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-fg);
    color: #fff;
    flex: 0 0 22px;
    transition: transform 220ms ease;
}

.accordion-item.is-open .accordion-icon {
    transform: rotate(90deg);
}

.accordion-content {
    height: 0;
    overflow: hidden;
    transition: height 260ms ease;
}

.accordion-inner {
    padding: 0 18px 18px 54px;
    color: var(--color-fg);
    opacity: 0.9;
    font-size: 15px;
    line-height: 1.55;
}

@media (max-width: 640px) {
    .accordion-inner {
        padding-left: 18px;
    }
    .accordion-title {
        font-size: 16px;
    }
}

.accordion-inner p {
    margin: 0;
}

.accordion-button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--color-fg) 55%, transparent);
    outline-offset: 2px;
    border-radius: 8px;
}

@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
    .accordion-button:focus-visible {
        outline: 2px solid var(--color-fg);
    }
}

/* Navbar */
.navbar {
    transition: box-shadow 0.3s ease;
}

.navbar__main-bar {
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar__header {
    transition: padding 0.3s ease;
}

.navbar--scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.navbar--scrolled .navbar__main-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.navbar--scrolled .navbar__header {
    padding-top: 8px;
    padding-bottom: 8px;
}

.navbar--scrolled .navbar__topbar {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.navbar__topbar {
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

/* WhatsApp pulse */
@keyframes whatsapp-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(97, 206, 112, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(97, 206, 112, 0); }
}
.navbar__whatsapp-btn {
    animation: whatsapp-pulse 2.5s ease-in-out infinite;
}

/* Navbar divider hides on scroll */
.navbar__divider {
    transition: opacity 0.3s ease;
}
.navbar--scrolled .navbar__divider {
    opacity: 0;
}

.navbar__link {
    position: relative;
    cursor: pointer;
}

@media (orientation: landscape) {
    .navbar__link {
        padding: 40px 0;
        margin: -40px 0;
    }
    /* Fix double-underline position inside padded navbar links */
    .navbar__link.nav-link-hover::before {
        bottom: 37px;
    }
    .navbar__link.nav-link-hover::after {
        bottom: 33px;
    }
}

.navbar__link-list {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--color-bg);
    border: 4px solid var(--color-accent);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50;
}

.navbar__link-list a {
    white-space: nowrap;
}

.navbar__link-list.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Animated Hamburger */
.navbar__hamburger {
    width: 44px;
    height: 44px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.navbar__hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-fg);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (min-width: 1024px) {
    .navbar__hamburger {
        display: none;
    }
}

.navbar__round {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    color: var(--color-bg);
    font-size: 14px;
}

.navbar__round--whatsapp {
    background: #61CE70;
}

/* Mobile Overlay */
.navbar__mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 60;
}

/* Mobile Panel — slides from right */
.navbar__mobile-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: min(380px, 85vw);
    background: var(--color-bg);
    z-index: 70;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Panel footer sticks to bottom */
.navbar__mobile-panel-footer {
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Mobile Menu Items */
.navbar__mobile-menu {
    display: flex;
    flex-direction: column;
}

/* Stagger animation for menu items */
.navbar__mobile-menu-item {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    transition-delay: calc(var(--index, 0) * 50ms);
}

.mobile-menu-visible .navbar__mobile-menu-item {
    opacity: 1;
    transform: translateX(0);
}

/* Bottom bar */
.navbar__mobile-bottombar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 1;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: var(--color-accent);
    z-index: 55;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.navbar__mobile-bottomitem {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--color-bg);
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
    min-width: 0;
    padding: 0 6px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

@media (max-width: 374px) {
    .navbar__mobile-bottomitem {
        font-size: 11px;
        gap: 4px;
        padding: 0 4px;
    }
}

.navbar__mobile-bottomitem+.navbar__mobile-bottomitem {
    border-left: 1px solid rgba(255, 255, 255, 0.25);
}

@media (min-width: 1024px) {
    .navbar__mobile-overlay,
    .navbar__mobile-panel,
    .navbar__mobile-bottombar {
        display: none;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .navbar__hamburger-line {
        transition: none;
    }
    .navbar__mobile-panel {
        transition-duration: 0.01ms !important;
    }
    .navbar__mobile-menu-item {
        transition: none;
        opacity: 1;
        transform: none;
    }
    .navbar__mobile-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .navbar__whatsapp-btn {
        animation: none;
    }
    .navbar__topbar {
        transition: none;
    }
    .navbar__main-bar {
        transition: none;
    }
}

/* Treatment steps */
.treatment-steps {
    padding-top: 24px;
}

.treatment-steps h2 {
    color: var(--color-fg);
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.2;
    margin: 0 0 18px;
}

.treatment-steps-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 1024px) {
    .treatment-steps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .treatment-steps-grid {
        grid-template-columns: 1fr;
    }
}

.treatment-step {
    background: #0E1F3B;
    color: #fff;
    border-radius: 14px;
    padding: 18px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
    cursor: default;
}

.treatment-step-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.treatment-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex: 0 0 auto;
    width: 40px;
    aspect-ratio: 1/1;
}

.treatment-step-icon i {
    font-size: 24px;
    line-height: 1;
}

.treatment-step-number {
    font-size: 44px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.02em;
    opacity: 0.95;
}

.treatment-step-body {
    margin-top: 14px;
    padding-left: 4px;
    margin-left: -4px;
    height: 100%;
    transition: 300ms;
    border-left-width: 4px;
    border-left-style: solid;
    border-left-color: rgba(0, 0, 0, 0);
}

.treatment-step:hover .treatment-step-body {
    border-left-color: var(--color-accent);
}

.treatment-step-title {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 700;
    color: #fff;
}

.treatment-step-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    opacity: 0.82;
}

.treatment-step:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #0E1F3B, #1a3154);
}

.treatment-step:hover .treatment-step-icon {
    color: var(--color-accent);
    transform: scale(1.1);
    transition: transform 0.3s ease, color 0.3s ease;
}

.treatment-step:hover .treatment-step-number {
    color: var(--color-accent);
    transition: color 0.3s ease;
}

.treatment-step--active {
    background: var(--color-accent);
}

/* Before/After Slider */
.before-after-slider {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.before-after-slider img {
    display: block;
    width: 100%;
    height: auto;
}

.before-after-slider .after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: inset(0 50% 0 0);
}

.before-after-slider .slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: white;
    cursor: ew-resize;
    transform: translateX(-50%);
}

.before-after-slider .slider-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 24px;
}

/* Graft Calculator */
.norwood-scale-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.norwood-scale-item {
    padding: 16px;
    border: 2px solid var(--color-fg);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.norwood-scale-item:hover,
.norwood-scale-item.selected {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: white;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .page-container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Footer Enhancements
   ======================================== */
footer h3 {
    position: relative;
    padding-bottom: 8px;
}
footer h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}
footer .space-y-6:hover h3::after {
    width: 50px;
}
footer a {
    color: inherit;
}
footer a:hover {
    opacity: 0.7;
}

/* ========================================
   Info Card Icon Glow
   ======================================== */
.info-card-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}
.info-card-wrapper:hover .info-card-icon {
    transform: scale(1.15);
    color: var(--color-accent);
}

/* ========================================
   Certificate Image Hover
   ======================================== */
.cert-image {
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: grayscale(30%);
}
.cert-image:hover {
    transform: scale(1.05);
    filter: grayscale(0%);
}

/* ========================================
   Norwood Scale Card Enhancement
   ======================================== */
.norwood-scale-item {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.norwood-scale-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* ========================================
   Genetic Test Card Hover Arrow
   ======================================== */
.genetic-card .fa-arrow-right {
    transition: transform 0.3s ease;
}
.genetic-card:hover .fa-arrow-right {
    transform: translateX(4px);
}

/* ========================================
   Clinic Section Image Hover
   ======================================== */
.clinic-image {
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}
.clinic-image:hover {
    transform: scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.transition-fast { transition: all 0.15s ease; }

/* ========================================
   Color utilities missing from the compiled Tailwind build
   ----------------------------------------
   The deployed build (app-*.css) did not emit these color utilities, so
   light-on-dark text (e.g. the footer, which uses `text-bg`) fell back to
   the inherited dark `--color-fg` and blended into the dark-blue background.
   These restore the intended colors. style.css loads after the build CSS,
   so these definitions take effect site-wide.
   ======================================== */
.text-bg { color: var(--color-bg); }
.text-bg-header { color: var(--color-bg-header); }
.text-fg-contrast { color: var(--color-fg-contrast); }
.text-accent { color: var(--color-accent); }
.bg-accent { background-color: var(--color-accent); }
