/**
 * Публичная главная страница / (index.html).
 * Подключать после /css/servicePortal.css (нужны CSS-переменные из tokens.css).
 */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-ui);
    background: var(--page-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ——— Hero ——— */
.hero {
    position: relative;
    min-height: 420px;
    padding: 0 24px 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero__bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 40, 80, 0.45) 0%, rgba(0, 60, 100, 0.35) 40%, rgba(227, 242, 253, 0.95) 100%),
        var(--image-header-bg) center/cover no-repeat;
    z-index: 0;
}

.hero__nav-slot {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--layout-content-narrow);
    padding: 12px 0 8px;
}

.hero__search-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 920px;
    margin-top: auto;
}

.hero__search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius-2xl);
    box-shadow: 0 12px 40px rgba(0, 40, 80, 0.18);
}

.hero__search input[type="text"] {
    flex: 1 1 200px;
    min-width: 160px;
    padding: 10px 12px;
    border: 1px solid #cfd8dc;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-family: inherit;
    box-sizing: border-box;
}

.hero__search input:focus {
    outline: none;
    border-color: var(--hero-blue);
}

.hero__search select {
    flex: 1 1 180px;
    min-width: 160px;
    padding: 14px 16px;
    border: 1px solid #cfd8dc;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--color-surface);
    cursor: pointer;
}

.btn-search {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--hero-blue);
    color: var(--color-surface);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.15s;
}

.btn-search:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

/* ——— FX ticker ——— */
.fx-top {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.88);
    border-radius: var(--radius-xl);
    border: 1px solid #b3e5fc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    color: #0b3b66;
    font-weight: 700;
    font-size: 0.72rem;
    line-height: 1.1;
    max-width: 240px;
}

.fx-top__date {
    font-size: 0.76rem;
}

.fx-top__line {
    font-weight: 700;
}

.fx-ticker {
    display: inline-block;
    font-size: 0.8rem;
    color: #37474f;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-md);
    border: 1px solid #b3e5fc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ——— Activity combobox ——— */
.activity-tor-wrap {
    position: relative;
    flex: 1 1 420px;
    min-width: 240px;
}

.activity-tor-wrap label {
    display: block;
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 700;
}

.activity-tor-hint {
    font-size: 10px;
    color: var(--color-text-soft);
    margin: 4px 0 0;
    line-height: 1.25;
}

.activity-tor-wrap input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd8dc;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-family: inherit;
    background: var(--color-surface);
    outline: none;
    box-sizing: border-box;
}

.activity-tor-wrap input[type="text"]:focus {
    border-color: var(--hero-blue);
}

.activity-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow: auto;
    background: var(--color-surface);
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-xl);
    z-index: 2500;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.12);
}

.activity-dropdown.show {
    display: block;
}

.activity-item {
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1f2937;
    border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--color-bg-hero-tint);
}

/* ——— Sections ——— */
main {
    flex: 1;
}

.section {
    max-width: var(--layout-content-narrow);
    margin: 0 auto;
    padding: 36px 24px 48px;
}

.section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.section__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    flex: 1 1 100%;
}

.section__link {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--hero-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.section__link:hover {
    border-bottom-color: var(--hero-blue);
}

.cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

@media (max-width: 1100px) {
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 720px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .hero {
        min-height: 380px;
        padding-bottom: 40px;
    }
}

@media (max-width: 420px) {
    .cards {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 3px solid transparent;
    box-shadow: 0 4px 18px rgba(0, 50, 100, 0.08);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    border-color: var(--card-border-hover);
    box-shadow: var(--shadow-card-lift);
    transform: translateY(-2px);
}

.card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.card__star {
    color: var(--star);
    font-size: 0.95rem;
}

.card__img-wrap {
    margin: 8px 10px 0;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #eceff1;
}

.card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card__body {
    padding: 12px 14px 16px;
}

.card__name {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
}

.card__sub {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card__sub .globe {
    font-size: 0.85rem;
}

/* ——— Footer ——— */
.site-footer {
    background: var(--footer-bg);
    color: rgba(255, 255, 255, 0.88);
    padding: 28px 24px 36px;
    margin-top: auto;
}

.site-footer__inner {
    max-width: var(--layout-content-narrow);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-footer__brand {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 0.8rem;
}

.site-footer__nav a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
}

.site-footer__nav a:hover {
    color: var(--color-surface);
}

/* ——— Modal (вход / регистрация) ——— */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(6px);
}

.modal-content {
    background: var(--color-surface);
    padding: 22px;
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    margin: 16px;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 14px;
    cursor: pointer;
    font-size: 24px;
    color: #bbb;
    line-height: 1;
    border: none;
    background: none;
    padding: 0;
}

.close-modal:hover {
    color: #666;
}

.modal-tabs {
    display: flex;
    margin-bottom: 14px;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 9px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-text-soft);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    margin-bottom: -1px;
}

.modal-form {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.modal-form.active {
    display: flex;
}

.modal-form input,
.modal-form select {
    padding: 9px 10px;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    width: 100%;
}

.modal-form input:focus,
.modal-form select:focus {
    border-color: var(--color-primary);
}

.modal-form > button {
    width: 100%;
    padding: 11px;
    font-size: 14px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
}

.btn-login-modal {
    background: var(--color-primary);
    color: var(--color-surface);
}

.btn-reg-modal {
    background: var(--color-success);
    color: var(--color-surface);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #444;
}

.checkbox-row input[type="checkbox"] {
    width: auto;
    margin: 0;
}

#businessBlock {
    display: none;
    flex-direction: column;
    gap: 10px;
}

#regEmailStatus {
    font-size: 12px;
    margin-top: -4px;
    min-height: 14px;
}

.password-hint {
    margin-top: -4px;
    margin-bottom: 2px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 7px;
    padding: 8px;
    font-size: 11px;
    color: #555;
}

.password-hint-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #444;
}

.password-rule {
    display: block;
    line-height: 1.35;
}

.rule-ok {
    color: #1e8e3e;
}

.rule-bad {
    color: #d93025;
}

/* Google Places поверх hero и модалок */
.pac-container {
    z-index: 20000 !important;
    font-family: inherit;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.pass-wrap {
    position: relative;
    width: 100%;
    display: block;
}

.pass-wrap input {
    width: 100%;
    margin: 0;
    padding-right: 46px;
    box-sizing: border-box;
}

.pass-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 0 !important;
    background: transparent;
    cursor: pointer;
    color: #666;
    font-size: 12px;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}

.pass-toggle:hover {
    color: #333;
}

.pass-toggle:focus {
    outline: none;
}

.reg-post-verify {
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid #e9ecef;
}

.reg-post-verify[hidden] {
    display: none !important;
}

.reg-post-verify:not([hidden]) {
    display: flex;
}

.reg-post-verify__hint {
    margin: 0;
    font-size: 12px;
    color: #444;
    line-height: 1.45;
}

.reg-verify-status {
    margin: 0;
    font-size: 12px;
    min-height: 16px;
}
