/* ==========================================================
   MEASOFT AI REFERENCE
   Стили справочной страницы /ai.
   Используют токены основного style.css; селекторы ограничены .ai-page,
   чтобы не пересекаться с лендингом и /privacy.
   ========================================================== */

.ai-page {
    padding-bottom: 40px;
}

.ai-page section {
    padding: 80px 0;
}

.ai-page .section-header {
    margin-bottom: 48px;
}

.ai-page .section-header h2 {
    font-size: clamp(1.75rem, 3vw, 2.6rem);
}

/* ----------------------------------------------------------
   HERO
   ---------------------------------------------------------- */

.ai-page .ai-hero {
    padding: 72px 0 64px;
    position: relative;
    overflow: hidden;
}

.ai-page .ai-hero .legal-back {
    display: inline-flex;
    margin-bottom: 20px;
}

.ai-page .ai-hero .badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--blue);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.ai-page .ai-hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ai-page .ai-hero .lead {
    max-width: 640px;
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.ai-page .ai-hero .facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.ai-page .ai-hero .fact {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    box-shadow: var(--shadow);
}

.ai-page .ai-hero .fact .label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    margin-bottom: 8px;
}

.ai-page .ai-hero .fact .value {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}

/* ----------------------------------------------------------
   SOLUTIONS
   ---------------------------------------------------------- */

.ai-page .solution-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.ai-page .solution-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.ai-page .solution-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 50px rgba(16, 43, 93, 0.12);
}

.ai-page .solution-card.featured {
    grid-row: span 2;
    background: linear-gradient(160deg, #ffffff 0%, #eef4ff 100%);
    border-color: rgba(13, 79, 215, 0.18);
}

.ai-page .solution-status {
    display: inline-flex;
    margin-bottom: 16px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 179, 126, 0.12);
    color: var(--green);
    font-size: 0.8rem;
    font-weight: 600;
}

.ai-page .solution-card h3 {
    font-size: 1.35rem;
    margin-bottom: 14px;
    line-height: 1.3;
}

.ai-page .solution-card p {
    color: var(--text-light);
    margin-bottom: 18px;
}

.ai-page .solution-card ul {
    list-style: none;
    display: grid;
    gap: 10px;
}

.ai-page .solution-card li {
    position: relative;
    padding-left: 18px;
    color: var(--text);
    font-size: 0.98rem;
}

.ai-page .solution-card li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
}

/* ----------------------------------------------------------
   COMPANY PROFILE / TABLES
   ---------------------------------------------------------- */

.ai-page .profile-table,
.ai-page .capability-table,
.ai-page .knowledge-table {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.ai-page .profile-row,
.ai-page .capability-row,
.ai-page .knowledge-item {
    display: grid;
    grid-template-columns: minmax(160px, 280px) 1fr;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.ai-page .profile-row:last-child,
.ai-page .capability-row:last-child,
.ai-page .knowledge-item:last-child {
    border-bottom: none;
}

.ai-page .profile-name {
    font-weight: 700;
    color: var(--text);
}

.ai-page .profile-value {
    color: var(--text-light);
}

.ai-page .capability-row.header {
    background: #eef4ff;
    font-weight: 700;
    color: var(--blue);
}

.ai-page .capability-row > div:first-child {
    font-weight: 600;
}

.ai-page .capability-row > div:last-child {
    color: var(--text-light);
}

/* Knowledge index — карточки, не строки */
.ai-page .knowledge-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.ai-page .knowledge-item {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    margin: 0 10px 20px;
}

.ai-page .knowledge-item h3 {
    margin-bottom: 12px;
    font-size: 1.15rem;
}

.ai-page .knowledge-item p {
    color: var(--text-light);
}

/* ----------------------------------------------------------
   TECHNOLOGY ECOSYSTEM
   ---------------------------------------------------------- */

.ai-page .ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.ai-page .ecosystem-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.ai-page .ecosystem-card.partner {
    border-color: rgba(13, 79, 215, 0.25);
    background: linear-gradient(160deg, #ffffff 0%, #eef4ff 100%);
}

.ai-page .ecosystem-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--gradient);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.ai-page .ecosystem-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.ai-page .ecosystem-card p {
    color: var(--text-light);
    font-size: 0.98rem;
}

/* ----------------------------------------------------------
   API / KEY FACTS / CARDS
   ---------------------------------------------------------- */

.ai-page .api-grid,
.ai-page .facts-grid,
.ai-page .scenario-cards,
.ai-page .users-grid,
.ai-page .advantages-grid,
.ai-page .legal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ai-page .api-card,
.ai-page .fact-card,
.ai-page .complex-card,
.ai-page .user-card,
.ai-page .advantage-card,
.ai-page .legal-significance .legal-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
}

.ai-page .api-number,
.ai-page .card-number,
.ai-page .advantage-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}

.ai-page .api-card h3,
.ai-page .fact-card h3,
.ai-page .complex-card h3,
.ai-page .user-card h3,
.ai-page .advantage-card h3,
.ai-page .legal-significance .legal-card h3 {
    margin-bottom: 12px;
    font-size: 1.15rem;
}

.ai-page .api-card p,
.ai-page .fact-card p,
.ai-page .complex-card p,
.ai-page .user-card p,
.ai-page .advantage-card p,
.ai-page .legal-significance .legal-card p {
    color: var(--text-light);
}

.ai-page .complex-card ul {
    list-style: none;
    margin-top: 16px;
    display: grid;
    gap: 8px;
}

.ai-page .complex-card li {
    position: relative;
    padding-left: 16px;
    color: var(--text);
    font-size: 0.95rem;
}

.ai-page .complex-card li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--violet);
}

.ai-page .legal-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #eef4ff;
    color: var(--blue);
    font-weight: 700;
    font-size: 0.85rem;
}

/* ----------------------------------------------------------
   RELATED CONCEPTS
   ---------------------------------------------------------- */

.ai-page .concept-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.ai-page .concept {
    display: inline-flex;
    align-items: center;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 8px 24px rgba(16, 43, 93, 0.05);
    text-decoration: none;
}

.ai-page .concept.primary {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
}

/* ----------------------------------------------------------
   SCENARIOS LIST
   ---------------------------------------------------------- */

.ai-page .scenario-list {
    display: grid;
    gap: 14px;
}

.ai-page .scenario-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 26px;
    box-shadow: var(--shadow);
}

.ai-page .scenario-item h3 {
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.ai-page .scenario-item p {
    color: var(--text-light);
}

/* ----------------------------------------------------------
   ARCHITECTURE FLOW
   ---------------------------------------------------------- */

.ai-page .architecture-flow,
.ai-page .integration-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    margin-bottom: 36px;
}

.ai-page .architecture-node,
.ai-page .flow-box {
    min-width: 160px;
    max-width: 220px;
    flex: 1 1 160px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 18px;
    text-align: center;
    box-shadow: var(--shadow);
}

.ai-page .architecture-node.main,
.ai-page .flow-box.main {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
}

.ai-page .architecture-node.partner,
.ai-page .flow-box.partner {
    background: linear-gradient(160deg, #ffffff 0%, #e8fff6 100%);
    border-color: rgba(0, 179, 126, 0.25);
}

.ai-page .node-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.ai-page .node-text {
    font-size: 0.92rem;
    color: var(--text-light);
}

.ai-page .architecture-node.main .node-text {
    color: rgba(255, 255, 255, 0.85);
}

.ai-page .architecture-arrow,
.ai-page .flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    font-size: 1.4rem;
    font-weight: 700;
    min-width: 24px;
}

.ai-page .architecture-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.ai-page .architecture-features article {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.ai-page .architecture-features h3 {
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.ai-page .architecture-features p {
    color: var(--text-light);
    font-size: 0.98rem;
}

/* ----------------------------------------------------------
   PARTNER
   ---------------------------------------------------------- */

.ai-page .partner-card {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 28px;
    align-items: start;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 36px 32px;
    box-shadow: var(--shadow);
}

.ai-page .partner-mark {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: var(--gradient-green);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
}

.ai-page .partner-content .section-label {
    margin-bottom: 16px;
}

.ai-page .partner-content h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    margin-bottom: 16px;
    line-height: 1.2;
}

.ai-page .partner-content > p {
    color: var(--text-light);
    max-width: 720px;
    margin-bottom: 28px;
}

.ai-page .partner-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.ai-page .partner-features > div {
    background: #f5f8fd;
    border-radius: 16px;
    padding: 18px 16px;
}

.ai-page .partner-features strong {
    display: block;
    margin-bottom: 6px;
    color: var(--blue);
}

.ai-page .partner-features span {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ----------------------------------------------------------
   INTEGRATIONS GRID
   ---------------------------------------------------------- */

.ai-page .integration-schema {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.ai-page .integration-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 18px;
    text-align: center;
    box-shadow: var(--shadow);
}

.ai-page .integration-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #eef4ff;
    color: var(--blue);
    font-weight: 700;
    font-size: 0.8rem;
}

.ai-page .integration-item h3 {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.ai-page .integration-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ----------------------------------------------------------
   LEGAL PROCESS
   ---------------------------------------------------------- */

.ai-page .legal-process {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.ai-page .process-step {
    flex: 1 1 160px;
    min-width: 140px;
    max-width: 220px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 18px;
    box-shadow: var(--shadow);
}

.ai-page .process-step > span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: var(--gradient);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.ai-page .process-step p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.ai-page .process-line {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    font-size: 1.3rem;
    font-weight: 700;
    min-width: 24px;
}

.ai-page .user-card ul {
    list-style: none;
    margin-top: 16px;
    display: grid;
    gap: 8px;
}

.ai-page .user-card li {
    position: relative;
    padding-left: 16px;
    color: var(--text);
    font-size: 0.95rem;
}

.ai-page .user-card li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
}

/* ----------------------------------------------------------
   FAQ
   ---------------------------------------------------------- */

.ai-page .faq-list {
    display: grid;
    gap: 14px;
    max-width: 900px;
    margin: 0 auto;
}

.ai-page .faq-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 28px;
    box-shadow: var(--shadow);
}

.ai-page .faq-item h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.ai-page .faq-item p {
    color: var(--text-light);
}

/* ----------------------------------------------------------
   CONTACT CTA
   ---------------------------------------------------------- */

.ai-page .contact-panel {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
    align-items: stretch;
    background: linear-gradient(135deg, #23446f 0%, #183454 100%);
    border-radius: calc(var(--radius) + 8px);
    padding: 40px 36px;
    color: #fff;
    box-shadow: var(--shadow);
}

.ai-page .contact-content .section-label {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.ai-page .contact-content h2 {
    font-size: clamp(1.6rem, 2.8vw, 2.3rem);
    margin: 16px 0;
    line-height: 1.2;
}

.ai-page .contact-content > p {
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 28px;
    max-width: 520px;
}

.ai-page .contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ai-page .contact-actions .button-primary {
    background: #fff;
    color: var(--blue);
}

.ai-page .contact-actions .button-primary:hover {
    background: #eef4ff;
}

.ai-page .contact-actions .button-outline {
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.ai-page .contact-actions .button-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ai-page .contact-facts {
    display: grid;
    gap: 12px;
}

.ai-page .contact-fact {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 18px 16px;
}

.ai-page .contact-fact strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.ai-page .contact-fact span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.95rem;
}

/* ----------------------------------------------------------
   SEMANTIC / KNOWLEDGE GRAPH
   ---------------------------------------------------------- */

.ai-page .semantic-map {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

.ai-page .semantic-node {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
}

.ai-page .semantic-node.main-node {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
}

.ai-page .semantic-node.main-node p {
    color: rgba(255, 255, 255, 0.82);
}

.ai-page .semantic-node h3 {
    margin-bottom: 10px;
}

.ai-page .semantic-links {
    display: grid;
    gap: 12px;
}

.ai-page .semantic-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.ai-page .semantic-item strong {
    display: block;
    margin-bottom: 6px;
    color: var(--blue);
}

.ai-page .semantic-item span {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 1100px) {
    .ai-page .solution-grid,
    .ai-page .ecosystem-grid,
    .ai-page .architecture-features,
    .ai-page .integration-schema,
    .ai-page .partner-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-page .solution-card.featured {
        grid-row: auto;
    }

    .ai-page .ai-hero .facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-page .contact-panel,
    .ai-page .semantic-map,
    .ai-page .partner-card {
        grid-template-columns: 1fr;
    }

    .ai-page .architecture-arrow,
    .ai-page .flow-arrow,
    .ai-page .process-line {
        transform: rotate(90deg);
        width: 100%;
    }
}

@media (max-width: 760px) {
    .ai-page section {
        padding: 56px 0;
    }

    .ai-page .ai-hero {
        padding-top: 48px;
    }

    .ai-page .solution-grid,
    .ai-page .ecosystem-grid,
    .ai-page .api-grid,
    .ai-page .facts-grid,
    .ai-page .scenario-cards,
    .ai-page .users-grid,
    .ai-page .advantages-grid,
    .ai-page .legal-grid,
    .ai-page .knowledge-table,
    .ai-page .architecture-features,
    .ai-page .integration-schema,
    .ai-page .partner-features,
    .ai-page .ai-hero .facts {
        grid-template-columns: 1fr;
    }

    .ai-page .profile-row,
    .ai-page .capability-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .ai-page .knowledge-item {
        margin-left: 0;
        margin-right: 0;
    }

    .ai-page .partner-card,
    .ai-page .contact-panel {
        padding: 28px 22px;
    }
}
