/**
 * Публичные страницы nd54.ru (apply, legal, regulations, agreement, privacy, thank-you).
 * Не подключать из личных кабинетов.
 */

/* --- Общая навигация назад --- */
.nd54-public-back-wrap {
    position: relative;
    z-index: 2;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0.75rem 1rem 0;
}

.nd54-public-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    transition: background 0.2s, transform 0.2s;
}

.nd54-public-back:hover {
    color: #fff;
    background: rgba(15, 23, 42, 0.28);
    transform: translateX(-2px);
}

/* --- Компактный hero для legal / regulations --- */
.nd54-public-subhero {
    position: relative;
    z-index: 2;
    margin: 0 auto 1.5rem;
    padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1rem, 3vw, 1.5rem);
    max-width: 920px;
    text-align: center;
    color: #fff;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(15, 52, 120, 0.55) 0%, rgba(34, 121, 189, 0.38) 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18);
}

.nd54-public-subhero__back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
}

.nd54-public-subhero__back:hover {
    color: #fff;
}

.nd54-public-subhero__title {
    margin: 0 0 0.65rem;
    font-family: var(--nd54-font-display, 'Manrope', system-ui, sans-serif);
    font-size: clamp(1.45rem, 3.5vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.nd54-public-subhero__lead {
    margin: 0 auto;
    max-width: 40rem;
    font-size: clamp(0.9rem, 2vw, 1rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}

/* Legal/regulations: унификация старого section-heading */
body.nd54-public-page.nd54-page-legal .section-heading {
    margin-bottom: 1.75rem;
    padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1rem, 3vw, 1.5rem);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(15, 52, 120, 0.55) 0%, rgba(34, 121, 189, 0.38) 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18);
}

body.nd54-public-page.nd54-page-legal .section-heading h2 {
    color: #fff !important;
    font-family: var(--nd54-font-display, 'Manrope', system-ui, sans-serif);
    font-size: clamp(1.45rem, 3.5vw, 2rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
}

body.nd54-public-page.nd54-page-legal .section-heading span {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: clamp(0.9rem, 2vw, 1rem);
    line-height: 1.55;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

body.nd54-public-page.nd54-page-legal .section-heading .line-dec {
    background: rgba(255, 255, 255, 0.45) !important;
}

/* --- Apply --- */
body.nd54-page-apply .nd54-public-back {
    color: var(--nd54-primary, #2279bd);
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(34, 121, 189, 0.22);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

body.nd54-page-apply .nd54-public-back:hover {
    color: var(--nd54-primary-dark, #1a5f96);
    background: #fff;
}

body.nd54-page-apply {
    font-family: var(--nd54-font, 'Inter', system-ui, sans-serif);
}

body.nd54-page-apply .main-card {
    border-radius: var(--nd54-radius-xl, 24px);
    box-shadow: var(--nd54-shadow-lg, 0 22px 50px rgba(15, 23, 42, 0.14));
}

body.nd54-page-apply .brand-header {
    background: linear-gradient(105deg, var(--nd54-primary, #2279bd) 0%, #198754 100%);
}

body.nd54-page-apply .btn-apply {
    min-height: 44px;
    border-radius: var(--nd54-radius-lg, 14px);
}

/* --- Thank you --- */
.nd54-thank-you-card {
    max-width: 560px;
    margin: clamp(3rem, 12vw, 6rem) auto;
    text-align: center;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background: rgba(255, 255, 255, 0.14);
    border-radius: var(--nd54-radius-xl, 20px);
    box-shadow: var(--nd54-shadow-lg, 0 22px 50px rgba(15, 23, 42, 0.14));
    border: 1px solid rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
}

.nd54-thank-you-card h1 {
    font-family: var(--nd54-font-display, 'Manrope', system-ui, sans-serif);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.nd54-thank-you-card .appeal-number {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.25);
    border-radius: var(--nd54-radius, 10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.nd54-thank-you-card .nd54-btn {
    margin-top: 1.25rem;
    min-height: 44px;
    min-width: 200px;
}

/* --- Документы (agreement, privacy) --- */
body.nd54-doc-page .nav-top a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

body.nd54-doc-page .nav-top a:hover {
    background: rgba(255, 255, 255, 0.22);
    opacity: 1;
}

body.nd54-doc-page .card {
    border-radius: var(--nd54-radius-xl, 20px);
}

body.nd54-doc-page h1 {
    font-family: var(--nd54-font-display, 'Manrope', system-ui, sans-serif);
}

/* --- News page --- */
body.nd54-page-news {
    min-height: 100vh;
    background: linear-gradient(160deg, #4aa0dd 0%, #2279bd 55%, #1e4a72 100%);
    font-family: var(--nd54-font, 'Inter', system-ui, sans-serif);
}

body.nd54-page-news .nd54-public-back {
    color: rgba(255, 255, 255, 0.95);
}

.nd54-news-page {
    position: relative;
    z-index: 2;
    padding-bottom: 2.5rem;
}

.nd54-news-page .nd54-public-subhero {
    margin-top: 0.5rem;
}

.nd54-news-empty {
    max-width: 520px;
    margin: 0 auto;
}

.nd54-news-empty .nd54-btn--primary {
    background: var(--nd54-primary, #2279bd);
    color: #fff;
}

.nd54-news-carousel {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nd54-news-carousel .carousel-item img {
    height: clamp(220px, 42vw, 420px);
    object-fit: cover;
}

.nd54-news-carousel__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: clamp(220px, 42vw, 420px);
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    color: #2279bd;
    font-size: 3rem;
}

.nd54-news-carousel__caption {
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.82) 100%);
    border-radius: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.25rem 1.5rem 1.5rem;
    text-align: left;
}

.nd54-news-carousel__caption h2 {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.nd54-news-carousel__caption p {
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
    opacity: 0.95;
}

.nd54-news-carousel__caption time {
    font-size: 0.78rem;
    opacity: 0.85;
}

@media (max-width: 576px) {
    .nd54-news-carousel__caption {
        position: static;
        background: #fff;
        color: #0f172a;
        padding: 1rem;
    }

    .nd54-news-carousel__caption p,
    .nd54-news-carousel__caption time {
        color: #475569;
        opacity: 1;
    }
}

@media (max-width: 576px) {
    .nd54-public-back-wrap {
        padding-top: 0.5rem;
    }

    body.nd54-public-page.nd54-page-legal .section {
        padding-top: 64px !important;
    }
}
