/* =========================================================
   TELEMED PLATFORM — тема Vaadin (Lumo)
   Шкала отступов: 8 / 16 / 24 / 32 / 48 px
   ========================================================= */


/* =========================================================
   ПЕРЕМЕННЫЕ
   ========================================================= */

html {

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;

    --lumo-primary-color: #16324F;
    --lumo-primary-text-color: #16324F;
    --lumo-primary-color-50pct: rgba(22, 50, 79, 0.5);
    --lumo-primary-color-10pct: rgba(22, 50, 79, 0.1);

    --lumo-base-color: #F7F5F0;
    --lumo-body-text-color: #2B3340;
    --lumo-secondary-text-color: #55606E;

    --lumo-success-color: #0F766E;
    --lumo-error-color: #B3452C;

    --lumo-font-family: 'IBM Plex Sans', Arial, sans-serif;
    --lumo-font-size-m: 1rem;
    --lumo-font-size-l: 1.125rem;

    --lumo-border-radius-m: 8px;
    --lumo-border-radius-l: 12px;

    --telemed-navy: #16324F;
    --telemed-text: #2B3340;
    --telemed-muted: #55606E;

    --telemed-accent: #B45309;
    --telemed-accent-hover: #9A4608;

    --telemed-teal: #0F766E;
    --telemed-focus: #1D6FB8;

    --doctor-card-bg: #FFFFFF;
    --doctor-card-border: rgba(22, 50, 79, 0.14);

    /* ---- Landing: фото ---- */
    --landing-photo-width: 48%;
    --landing-photo-height: 80vh;
    --landing-photo-height-mobile: 24vh;
    --landing-text-width: 58%;
    --landing-text-shift: 17vw;

    --landing-photo-url: url('./images/Online Doctor-pana.svg');

    --landing-photo-brightness: 1;
    --landing-photo-saturate: 1.15;
    --landing-photo-contrast: 1.05;
    --landing-photo-opacity: 1;

    /* ---- Подъезд списка врачей (значения ставит Java/JS) ---- */
    --landing-reveal-gap: 100vh;
    --landing-reveal-duration: 450ms;
    --landing-reveal-easing: ease-out;
}


/* =========================================================
   ОБЩЕЕ
   ========================================================= */

:focus-visible {
    outline: 3px solid var(--telemed-focus);
    outline-offset: 2px;
}

vaadin-app-layout {
    min-height: 100vh;
}


/* =========================================================
   ВЕРХНЯЯ ПАНЕЛЬ
   ========================================================= */

.telemed-navbar {
    min-height: 72px;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(22, 50, 79, 0.12);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    z-index: 100;
}

.telemed-logo {
    object-fit: cover;
    border-radius: 8px;
}

.telemed-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: 1.55rem;
    color: var(--telemed-navy);
    letter-spacing: -0.02em;
}


/* =========================================================
   БОКОВОЕ МЕНЮ (DRAWER)
   ========================================================= */

vaadin-drawer-toggle {
    --lumo-size-m: 3rem;
    color: var(--telemed-navy);
}

.telemed-nav-link {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--telemed-navy);
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.telemed-nav-link:hover {
    background: rgba(22, 50, 79, 0.08);
}

.telemed-nav-link[highlight] {
    background: rgba(22, 50, 79, 0.12);
}

.telemed-nav-content {
    padding: 4px 8px;
    gap: 14px;
}

.telemed-nav-content vaadin-icon {
    color: var(--telemed-navy);
}

vaadin-app-layout [slot="drawer"] vaadin-button {
    font-size: 1.25rem;
    --lumo-size-m: 3rem;
    justify-content: flex-start;
}


/* =========================================================
   ГЛАВНЫЙ ФОН + ФОТО
   ========================================================= */

.main-background {
    position: relative;
    background-color: var(--lumo-base-color);
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: clip;                 /* ничего не уезжает вправо за экран */
}

.main-background::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    width: var(--landing-photo-width);
    height: var(--landing-photo-height);
    background-image: var(--landing-photo-url);
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    border-radius: 0 0 0 16px;
    filter:
            brightness(var(--landing-photo-brightness))
            saturate(var(--landing-photo-saturate))
            contrast(var(--landing-photo-contrast));
    opacity: var(--landing-photo-opacity);
    z-index: 0;
}

.main-background > * {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    min-width: 0;
}

/* Планшеты и ноутбуки: текст только слева */
@media (min-width: 701px) {
    .main-background > *:not(.doctor-section) {
        max-width: var(--landing-text-width);
        text-align: left;
        align-items: flex-start;
    }
}

/* Широкие экраны: сдвиг влево */
@media (min-width: 1100px) {
    .main-background > *:not(.doctor-section) {
        transform: translateX(calc(var(--landing-text-shift) * -1));
    }
}


/* =========================================================
   КОНТЕНТ
   ========================================================= */

.main-content {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}


/* =========================================================
   HERO
   ========================================================= */

.hero-title {
    margin: 0 0 16px 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2rem, 3.6vw, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--telemed-navy);
    text-align: left;
}

.hero-subtitle {
    max-width: 640px;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--telemed-text);
    text-align: left;
}

/* Бейдж цены */
.price-badge {
    display: inline-block;
    margin: 16px 0 0;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: var(--telemed-teal);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Подсказка под кнопками */
.ai-hint {
    max-width: 520px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--telemed-muted);
}


/* =========================================================
   ШАГИ 1-2-3 (тёмные кружки + линия на десктопе)
   ========================================================= */

.stats-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 32px;
    margin-top: 24px;
}

.stats-inline vaadin-vertical-layout span:last-child {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--telemed-muted);
}

.stats-inline vaadin-vertical-layout span.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    box-sizing: border-box;
    border-radius: 50%;
    background: var(--telemed-navy);
    border: 2px solid var(--telemed-navy);
    color: #FFFFFF;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}


/* Десктоп: шаги в один ряд с соединительной линией */
@media (min-width: 701px) {

    .stats-inline {
        --step-w: 140px;              /* ширина одного шага */
        --step-gap: 40px;             /* расстояние между шагами */

        flex-wrap: nowrap;
        align-items: flex-start;
        gap: var(--step-gap);
    }

    .stats-inline > vaadin-vertical-layout {
        position: relative;
        flex: 0 0 var(--step-w);
        width: var(--step-w);
        padding: 0;
        text-align: center;
    }

    .stats-inline vaadin-vertical-layout span:last-child {
        line-height: 1.3;
        text-wrap: balance;
    }

    /* Линия от своего круга до следующего */
    .stats-inline > vaadin-vertical-layout:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 19px;                                  /* центр круга 40px */
        left: calc(50% + 28px);                     /* радиус 20px + зазор 8px */
        width: calc(100% + var(--step-gap) - 56px);
        height: 2px;
        background: rgba(22, 50, 79, 0.28);
        border-radius: 1px;
    }
}

/* Узкие ноутбуки и планшеты: компактнее */
@media (min-width: 701px) and (max-width: 1000px) {

    .stats-inline {
        --step-w: 104px;
        --step-gap: 24px;
    }
}


/* =========================================================
   CTA-КНОПКИ
   ========================================================= */

.hero-cta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 16px;
}

.hero-cta-row vaadin-button {
    min-width: 250px;
    min-height: 54px;
    padding: 0 28px;
    font-size: 1.0625rem;
    font-weight: 600;
    border-radius: 10px;
}

vaadin-button[theme~="primary"] {
    background: var(--telemed-accent);
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.28);
}

vaadin-button[theme~="primary"]:hover {
    background: var(--telemed-accent-hover);
}

.ai-triage-button {
    background: transparent;
    color: var(--telemed-navy);
    font-weight: 600;
    border: 2px solid var(--telemed-navy);
    box-shadow: none;
}

.ai-triage-button:hover {
    background: rgba(22, 50, 79, 0.08);
}


/* =========================================================
   СЕКЦИЯ ВРАЧЕЙ
   ========================================================= */

.doctor-section {
    position: relative;
    width: 100%;
    padding: 0;
    margin-top: var(--landing-reveal-gap, 100vh);
    transition:
            margin-top
            var(--landing-reveal-duration, 450ms)
            var(--landing-reveal-easing, ease-out);
}

.doctor-section h2 {
    margin: 0 0 8px 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--telemed-navy);
}


/* =========================================================
   ЧИПЫ СПЕЦИАЛЬНОСТЕЙ (переносятся на новую строку)
   ========================================================= */

.specialty-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 0 16px;
}

.specialty-chips .chip {
    flex: 0 0 auto;
    min-height: 40px;
    margin: 0;
    padding: 0 16px;
    border-radius: 999px;
    border: 1.5px solid rgba(22, 50, 79, 0.3);
    background: #FFFFFF;
    color: var(--telemed-navy);
    font-weight: 600;
}

.specialty-chips .chip.chip-active {
    background: var(--telemed-navy);
    border-color: var(--telemed-navy);
    color: #FFFFFF;
}


/* =========================================================
   СЕТКА И КАРТОЧКА ВРАЧА
   ========================================================= */

.doctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
    padding: 16px 0 32px;
    box-sizing: border-box;
}

.doctor-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 250px;
    min-width: 0;
    box-sizing: border-box;
    padding: 20px;
    background: var(--doctor-card-bg);
    border-radius: 14px;
    border: 1px solid var(--doctor-card-border);
    box-shadow: 0 2px 10px rgba(22, 50, 79, 0.08);
    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

.doctor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(22, 50, 79, 0.14);
}

.doctor-card h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--telemed-navy);
    text-transform: capitalize;
}

.doctor-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.doctor-name-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.doctor-specialty {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--telemed-teal);
}

.doctor-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.price-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(22, 50, 79, 0.07);
    color: var(--telemed-navy);
    font-size: 0.9rem;
    font-weight: 600;
}

.price-pill vaadin-icon,
.price-pill-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.doctor-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--telemed-muted);
}

.doctor-rating {
    font-weight: 700;
    color: #8A5A00;
}

.doctor-card-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: auto;
    padding-top: 12px;
}

.doctor-card-actions vaadin-button {
    flex: 1;
    min-height: 48px;
    height: auto;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
}

.doctor-card-profile-button {
    background: transparent;
    color: var(--telemed-navy);
    border: 1.5px solid rgba(22, 50, 79, 0.35);
    font-weight: 600;
}

.doctor-card-profile-button:hover {
    background: rgba(22, 50, 79, 0.08);
    border-color: rgba(22, 50, 79, 0.55);
}


/* =========================================================
   ТЕЛЕФОН (до 700px) — в конце, чтобы перекрывать общее
   ========================================================= */

@media (max-width: 700px) {

    .telemed-navbar {
        min-height: 64px;
        padding: 8px 10px !important;
    }

    .telemed-logo {
        width: 36px;
        height: 36px;
    }

    .telemed-title {
        font-size: 1.25rem;
    }

    .main-background {
        width: 100%;
        min-height: calc(100vh - 64px);
        padding:
                calc(var(--landing-photo-height-mobile) + 16px)
                16px
                32px;
    }

    .main-background::before {
        width: 100%;
        height: var(--landing-photo-height-mobile);
        background-position: center;
        border-radius: 0 0 16px 16px;
    }

    /* Всё по центру, без сдвига, строго в ширину экрана */
    .main-background > *:not(.doctor-section) {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        transform: none;
        align-items: center;
    }

    .hero-title {
        margin-bottom: 12px;
        font-size: 1.85rem;
        line-height: 1.2;
        text-align: center;
    }

    .hero-subtitle {
        max-width: 100%;
        margin: 0 auto;
        font-size: 1rem;
        line-height: 1.55;
        text-align: center;
    }

    .price-badge {
        align-self: center;
    }

    .ai-hint {
        max-width: 100%;
        text-align: center;
    }

    /* Шаги: три равные колонки */
    .stats-inline {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        --step-gap: 8px;
        gap: 12px var(--step-gap);
        width: 100%;
        margin-top: 16px;
        text-align: center;
        align-items: start;
    }

    .stats-inline vaadin-vertical-layout {
        align-items: center !important;
        justify-content: flex-start !important;
        min-width: 0;
        padding: 0;
    }

    .stats-inline vaadin-vertical-layout span {
        text-align: center;
        line-height: 1.25;
        overflow-wrap: break-word;
        text-wrap: balance;
    }

    .stats-inline vaadin-vertical-layout span:last-child {
        font-size: 0.875rem;
        min-height: 3.75em;
    }

    /* Линия между кругами (как на десктопе) */
    .stats-inline > vaadin-vertical-layout {
        position: relative;
    }

    .stats-inline > vaadin-vertical-layout:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 19px;                                  /* центр круга 40px */
        left: calc(50% + 28px);                     /* радиус 20px + зазор 8px */
        width: calc(100% + var(--step-gap) - 56px);
        height: 2px;
        background: rgba(22, 50, 79, 0.28);
        border-radius: 1px;
    }

    .hero-cta-row {
        flex-direction: column;
        justify-content: center;
        width: 100%;
        gap: 12px;
        margin-top: 20px;
        margin-bottom: 16px;
    }

    .hero-cta-row vaadin-button {
        width: 100%;
        min-width: 0;
        min-height: 52px;
    }

    .doctor-section h2 {
        font-size: 1.5rem;
    }

    .doctor-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .doctor-card {
        min-height: 220px;
        padding: 16px;
    }
}


/* =========================================================
   УМЕНЬШЕННАЯ АНИМАЦИЯ
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .doctor-section,
    .doctor-card,
    .telemed-nav-link {
        transition: none;
    }

    .doctor-card:hover {
        transform: none;
    }
}