/* ========================================
   ERMIAS — Sub-Pages Components (sp-*)
   Выделено из components.css (T8)
   Загружается ПЕРЕД components.css:
   responsive-правила в components.css сохраняют приоритет каскада.
   ======================================== */

/* Page wrapper */
.sp-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ed-bg-primary);
}

/* Container */
.sp-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Page Header */
.sp-page-header {
    padding: 80px 24px 48px;
    text-align: center;
    background: var(--ed-bg-primary);
}

.sp-page-header__container {
    max-width: 800px;
    margin: 0 auto;
}

.sp-page-title,
.sp-page-header__title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    color: var(--ed-text-primary);
    line-height: 1.15;
    margin: 0 0 16px;
}

.sp-page-subtitle,
.sp-page-header__subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--ed-text-secondary);
    line-height: 1.6;
    margin: 0 0 12px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.sp-page-date {
    font-size: 0.8125rem;
    color: var(--ed-text-secondary);
    margin: 0;
    opacity: 0.7;
}

.sp-page-header__badge {
    display: inline-block;
    color: var(--ed-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding: 4px 12px;
    border: 1px solid var(--ed-accent);
    border-radius: 50px;
}

/* Light theme header adjustments */
body.sub-page[data-theme="light"] .sp-page-header,
body.hub-page[data-theme="light"] .sp-page-header {
    border-bottom-color: var(--ed-border) !important;
}

/* Content Section */
.sp-section {
    padding: 64px 24px;
    background: var(--ed-bg-primary);
}

.sp-section--alt {
    background: var(--ed-bg-tertiary);
}

.sp-section__container {
    max-width: 1000px;
    margin: 0 auto;
}

.sp-section__title {
    font-size: clamp(1.375rem, 3vw, 1.75rem);
    font-weight: 700;
    color: var(--ed-text-primary);
    text-align: center;
    margin: 0 0 40px;
}

.sp-section__text {
    font-size: 1rem;
    color: var(--ed-text-body);
    line-height: 1.7;
    max-width: 720px;
    margin: 0 auto 24px;
    text-align: center;
}

/* Feature Cards */
.sp-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.sp-feature-card {
    background: var(--ed-bg-card);
    border: 1px solid var(--ed-border);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    transition: border-color 0.25s, transform 0.25s;
}

.sp-feature-card:hover {
    border-color: var(--ed-accent);
    transform: translateY(-4px);
}

.sp-feature-card__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--ed-accent-subtle);
    color: var(--ed-accent);
    font-size: 24px;
}

.sp-feature-card__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ed-text-primary);
    margin: 0 0 12px;
}

.sp-feature-card__desc {
    font-size: 0.9375rem;
    color: var(--ed-text-body);
    line-height: 1.6;
    margin: 0;
}

/* Info Card (для юридических страниц) */
.sp-info-card {
    background: var(--ed-bg-card);
    border: 1px solid var(--ed-border);
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 24px;
}

.sp-info-card--accent {
    border-color: var(--ed-accent);
    background: linear-gradient(90deg, var(--ed-accent-subtle) 0%, var(--ed-bg-card) 100%);
}

.sp-info-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ed-text-primary);
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ed-border);
}

.sp-info-card__text {
    font-size: 0.9375rem;
    color: var(--ed-text-body);
    line-height: 1.7;
    margin: 0 0 16px;
}

.sp-info-card__text:last-child {
    margin-bottom: 0;
}

.sp-info-card__list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.sp-info-card__list li {
    position: relative;
    padding-left: 20px;
    font-size: 0.9375rem;
    color: var(--ed-text-body);
    line-height: 1.7;
    margin-bottom: 8px;
}

.sp-info-card__list li::before {
    content: '·';
    position: absolute;
    left: 0;
    color: var(--ed-accent);
    font-weight: 700;
}

.sp-info-card__heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ed-text-primary);
    margin: 24px 0 12px;
}

.sp-info-card__heading:first-child {
    margin-top: 0;
}

.sp-info-card__subtitle {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ed-text-primary);
    margin: 24px 0 12px;
}

.sp-info-card__subtitle:first-child {
    margin-top: 0;
}

.sp-info-card__content {
    font-size: 0.9375rem;
    color: var(--ed-text-body);
    line-height: 1.7;
}

.sp-info-card__content p {
    margin: 0 0 16px;
}

.sp-info-card__content p:last-child {
    margin-bottom: 0;
}

/* Contact Form */
.sp-form {
    max-width: 560px;
    margin: 0 auto;
}

.sp-form__group {
    margin-bottom: 20px;
}

.sp-form__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ed-text-primary);
    margin-bottom: 8px;
}

.sp-form__input,
.sp-form__textarea {
    width: 100%;
    background: var(--ed-bg-input);
    border: 1px solid var(--ed-border);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    color: var(--ed-text-primary);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 44px;
}

.sp-form__textarea {
    min-height: 140px;
    resize: vertical;
}

.sp-form__input:focus,
.sp-form__textarea:focus {
    outline: none;
    border-color: var(--ed-accent);
    box-shadow: 0 0 0 3px var(--ed-accent-subtle);
}

.sp-form__input::placeholder,
.sp-form__textarea::placeholder {
    color: var(--ed-text-secondary);
}

/* Contact Field (static input-like display for emails/links) */
.sp-contact-field {
    display: flex;
    align-items: center;
    cursor: default;
}

.sp-contact-field a {
    color: var(--ed-accent);
    text-decoration: none;
    transition: color 0.2s;
    word-break: break-all;
}

.sp-contact-field a:hover {
    color: var(--ed-link-hover);
    text-decoration: underline;
}

/* Contact Layout (2 колонки) */
.sp-contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.sp-contact-info {
    padding-right: 24px;
}

.sp-contact-info__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ed-text-primary);
    margin: 0 0 16px;
}

.sp-contact-info__text {
    font-size: 1rem;
    color: var(--ed-text-body);
    line-height: 1.7;
    margin: 0 0 24px;
}

/* CTA Block */
.sp-cta-block {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(90deg, var(--ed-accent-subtle) 0%, transparent 100%);
    border-top: 1px solid var(--ed-border);
    border-bottom: 1px solid var(--ed-border);
}

.sp-cta-block__container {
    max-width: 600px;
    margin: 0 auto;
}

.sp-cta-block__title {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--ed-text-primary);
    margin: 0 0 12px;
}

.sp-cta-block__text {
    font-size: 1rem;
    color: var(--ed-text-body);
    margin: 0 0 24px;
}

.sp-cta-block__actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Payment Block */
.sp-payment-block {
    background: var(--ed-bg-card);
    border: 1px solid var(--ed-border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    max-width: 480px;
    margin: 40px auto 0;
}

.sp-payment-block__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ed-text-primary);
    margin: 0 0 12px;
}

.sp-payment-block__text {
    font-size: 0.9375rem;
    color: var(--ed-text-body);
    line-height: 1.6;
    margin: 0 0 20px;
}

/* TOC (Table of Contents) для юридических страниц */
.sp-toc {
    background: var(--ed-bg-card);
    border: 1px solid var(--ed-border);
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 32px;
}

.sp-toc__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ed-text-primary);
    margin: 0 0 12px;
}

.sp-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 32px;
    counter-reset: toc-counter;
}

.sp-toc__list li {
    margin-bottom: 8px;
    break-inside: avoid;
    counter-increment: toc-counter;
}

.sp-toc__list a {
    color: var(--ed-accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
}

.sp-toc__list a:hover {
    color: var(--ed-link-hover);
    text-decoration: underline;
}

.sp-toc ol.sp-toc__list {
    list-style: decimal;
    padding-left: 20px;
    columns: 1;
}

.sp-toc ol.sp-toc__list li {
    margin-bottom: 6px;
}

.sp-toc ol.sp-toc__list a {
    min-height: auto;
    line-height: 1.6;
}

/* Links */
.sp-link {
    color: var(--ed-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.sp-link:hover {
    color: var(--ed-link-hover);
    text-decoration: underline;
}

/* Product Grid */
.sp-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}