:root {
    --purple: #bc8ac8;
    --purple-d: #774c83;
    --purple-l:  #f3effe;
    --purple-m:  #e8dff8;
    --text:      #1a1a2e;
    --muted:     #6b7280;
    --border:    #e5e7eb;
    --bg:        #ffffff;
    --bg-soft:   #f9f7fd;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Unbounded', sans-serif; }

.topbar {
    background: var(--purple);
    color: rgba(255,255,255,.9);
    font-size: 1.2rem;
    padding: .5rem 0;
    text-align: center;
    letter-spacing: .02em;
}

.hero {
    background: linear-gradient(135deg, var(--bg-soft) 0%, var(--purple-l) 100%);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -120px; right: -120px;
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(107,79,160,.12) 0%, transparent 70%);
    pointer-events: none;
}

.badge-tag {
    display: inline-block;
    background: var(--purple-m);
    color: var(--purple);
    border: 1px solid rgba(107,79,160,.25);
    border-radius: 100px;
    padding: .3rem 1rem;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    line-height: 1.2;
    letter-spacing: -.02em;
}
.hero-title .accent { color: var(--purple); }

.login-title {
    font-size: clamp(1.8rem, 4.5vw, 1.2rem);
    line-height: 1.2;
    letter-spacing: -.02em;
}
.login-title .accent { color: var(--purple); }

.hero-sub {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 500px;
    line-height: 1.7;
}

.btn-primary-custom {
    background: var(--purple);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .8rem 1.8rem;
    font-family: 'Unbounded', sans-serif;
    font-size: .88rem;
    font-weight: 600;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 18px rgba(107,79,160,.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.btn-primary-custom:hover {
    background: var(--purple-d);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(107,79,160,.4);
    color: #fff;
}

.btn-outline-custom {
    background: transparent;
    color: var(--purple);
    border: 1.5px solid var(--purple);
    border-radius: 10px;
    padding: .8rem 1.8rem;
    font-family: 'Unbounded', sans-serif;
    font-size: .88rem;
    font-weight: 600;
    transition: background .2s, color .2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.btn-outline-custom:hover { background: var(--purple); color: #fff; }

.quick-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(107,79,160,.08);
}

.section-label {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--purple);
    margin-bottom: .4rem;
}

.pain-section {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.pain-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    font-size: 1.1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--border);
}
.pain-item:last-child { border-bottom: none; }
.pain-icon { color: #dc2626; font-size: 1.1rem; margin-top: .1rem; flex-shrink: 0; }

.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 2rem;
    height: 100%;
    transition: border-color .25s, transform .25s, box-shadow .25s;
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--purple);
    transform: scaleX(0);
    transition: transform .3s;
    transform-origin: left;
}
.feature-card:hover {
    border-color: rgba(107,79,160,.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(107,79,160,.1);
}
.feature-card:hover::before { transform: scaleX(1); }
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h4 { font-size: 1rem; margin-bottom: .65rem; letter-spacing: -.01em; }
.feature-card p { color: var(--muted); font-size: .875rem; line-height: 1.65; margin: 0; }

.check-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.check-list li {
    display: flex; align-items: flex-start; gap: .6rem;
    color: var(--muted); font-size: .975rem; margin-bottom: .45rem;
}
.check-list li i { color: var(--purple); margin-top: .15rem; flex-shrink: 0; }

.result-card {
    background: var(--purple-l);
    border: 1px solid rgba(107,79,160,.15);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    transition: transform .2s, box-shadow .2s;
}
.result-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(107,79,160,.12); }
.result-card i { font-size: 1.5rem; color: var(--purple); flex-shrink: 0; }
.result-card span { font-size: .975rem; font-weight: 500; }

.pricing-card {
    background: #fff;
    border: 2px solid rgba(107,79,160,.2);
    border-radius: 22px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(107,79,160,.1);
}
.pricing-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--purple), #a67dd4);
}

.price-amount {
    font-family: 'Unbounded', sans-serif;
    font-size: 2.6rem; font-weight: 800;
    color: var(--purple); line-height: 1;
}

.free-badge {
    background: var(--purple); color: #fff;
    font-family: 'Unbounded', sans-serif;
    font-size: .65rem; font-weight: 700;
    padding: .3rem .85rem; border-radius: 100px;
    letter-spacing: .06em;
}

.teal-sep { width: 40px; height: 3px; background: var(--purple); border-radius: 2px; margin: 1rem 0 1.5rem; }

.instruction-btn {
    display: flex; align-items: center; gap: 1rem;
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px; padding: 1.1rem 1.4rem;
    color: var(--text); text-decoration: none;
    transition: border-color .2s, box-shadow .2s; width: 100%;
}
.instruction-btn:hover { border-color: var(--purple); box-shadow: 0 4px 16px rgba(107,79,160,.12); color: var(--purple); }
.instruction-btn > i:first-child { font-size: 1.4rem; color: var(--purple); }
.instruction-btn span { font-size: .875rem; font-weight: 600; }

.contact-card {
    background: linear-gradient(135deg, var(--purple) 0%, #9370c8 100%);
    border-radius: 22px; padding: 3rem; color: #fff;
}
.contact-card .section-label { color: rgba(255,255,255,.7); }
.contact-card h2 { color: #fff; }
.contact-card p { color: rgba(255,255,255,.8); }

.btn-white {
    background: #fff; color: var(--purple); border: none;
    border-radius: 10px; padding: .8rem 1.8rem;
    font-family: 'Unbounded', sans-serif; font-size: .78rem; font-weight: 700;
    transition: background .2s, transform .15s;
    text-decoration: none; display: inline-flex; align-items: center;
}
.btn-white:hover { background: var(--purple-l); transform: translateY(-2px); color: var(--purple); }

.btn-outline-white {
    background: transparent; color: #fff;
    border: 1.5px solid rgba(255,255,255,.6);
    border-radius: 10px; padding: .8rem 1.8rem;
    font-family: 'Unbounded', sans-serif; font-size: .78rem; font-weight: 600;
    transition: background .2s; text-decoration: none;
    display: inline-flex; align-items: center;
}
.btn-outline-white:hover { background: rgba(255,255,255,.15); border-color: #fff; color: #fff; }

.pulse-dot {
    display: inline-block; width: 9px; height: 9px;
    background: var(--purple); border-radius: 50%;
    animation: pulse 2s infinite; margin-right: .4rem;
}
@keyframes pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(107,79,160,.5); }
    50%      { box-shadow: 0 0 0 7px rgba(107,79,160,0); }
}

footer { background: var(--bg-soft); border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; }
.footer-brand { font-family: 'Unbounded', sans-serif; color: var(--purple); font-size: .95rem; font-weight: 700; }

.instructions-section .feature-card {
    height: auto;
}

.instructions-section::before .feature-card::before{}
.instructions-section:hover .feature-card:hover{}
.instructions-section:hover::before .feature-card:hover::before{}
.instructions-section h4 .feature-card h4{}
.instructions-section p .feature-card p{}

.instructions-section img {
    border: 1px solid var(--border);
    max-width: 100%;   /* не превышает ширину колонки */
    height: auto;      /* сохраняет пропорции */
    max-height: 600px; /* можно оставить, если хочешь лимит по высоте */
    display: block;
}

/* Лейблы */
.form-label {
    color: var(--purple);
    font-weight: 500;
}

/* Инпуты */
.form-control {
    border: 1px solid var(--border);
    color: var(--purple);
    transition: all 0.2s ease;
}

/* Плейсхолдер */
.form-control::placeholder {
    color: var(--purple-d);
}

/* Фокус */
.form-control:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.2);
    color: var(--purple);
}

/* Убираем стандартный синий Bootstrap */
.form-control:focus {
    outline: none;
}

/* Активное состояние (когда вводишь) */
.form-control:not(:placeholder-shown) {
    color: var(--purple-d);
}

.form-control:hover {
    border-color: var(--purple-d);
}

.navbar-custom {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .85rem 0;
}

.navbar-brand-text:hover {
    background: var(--purple-d);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(107,79,160,.4);
    color: #fff;
}
.navbar-brand-text {
    background: var(--purple);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .8rem 1.8rem;
    font-family: 'Unbounded', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 18px rgba(107,79,160,.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.btn-logout {
    background: transparent;
    color: var(--purple);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .4rem 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    transition: border-color .2s, color .2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.btn-logout:hover {
    background: var(--purple-d);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(107,79,160,.4);
    color: #fff;
}

/* ── HERO HEADER ── */
.page-header {
    background: linear-gradient(135deg, var(--purple) 0%, #9370c8 100%);
    padding: 2.5rem 0 3.5rem;
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    bottom: -40px; right: -40px;
    width: 240px; height: 240px;
    background: rgba(255,255,255,.07);
    border-radius: 50%;
}
.page-header::after {
    content: '';
    position: absolute;
    top: -60px; left: -60px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}

.avatar-circle {
    width: 64px; height: 64px;
    background: rgba(255,255,255,.2);
    border: 2px solid rgba(255,255,255,.4);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Unbounded', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.page-header h1 {
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
    letter-spacing: -.01em;
}
.page-header .sub {
    color: rgba(255,255,255,.7);
    font-size: .85rem;
    margin-top: .25rem;
}

/* ── CARDS ── */
.info-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: 0 2px 16px rgba(107,79,160,.06);
    margin-top: -1.5rem;
    position: relative;
}

.card-section-title {
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--purple);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.card-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.info-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row:first-child { padding-top: 0; }

.info-icon {
    width: 38px; height: 38px;
    background: var(--purple-l);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--purple);
    font-size: 1rem;
    flex-shrink: 0;
}

.info-label {
    font-size: .75rem;
    color: var(--muted);
    margin-bottom: .15rem;
}
.info-value {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
}

/* ── SYNC BADGE ── */
.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #16a34a;
    border-radius: 100px;
    border: 1px solid var(--border);
    padding: .2rem .75rem;
    font-size: .85rem;
    font-weight: 600;
}
.sync-badge.active {
    color: #28a745; /* зеленый */
}

.sync-badge.inactive {
    color: #dc3545; /* красный */
}
.sync-dot {
    width: 7px; height: 7px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
    0%,100% { box-shadow: 0 0 0 0 rgba(22,163,74,.4); }
    50%      { box-shadow: 0 0 0 5px rgba(22,163,74,0); }
}

/* ── TABLE CARD ── */
.table-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: 0 2px 16px rgba(107,79,160,.06);
}

.table-link-block {
    background: var(--purple-l);
    border: 1px solid rgba(107,79,160,.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.table-link-block i { font-size: 1.5rem; color: var(--purple); flex-shrink: 0; }
.table-link-block a {
    background: transparent;
    color: var(--purple);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    word-break: break-all;
}
.table-link-block a:hover { text-decoration: underline; }

/* ── PENDING STATE ── */
.table-pending {
    text-align: center;
    padding: 1.5rem 1rem;
}
.pending-spinner {
    position: relative;
    width: 64px; height: 64px;
    margin: 0 auto 1.25rem;
}
.spinner-ring {
    position: absolute;
    inset: 0;
    border: 3px solid var(--purple-m);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin .9s linear infinite;
}
.pending-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--purple);
}
.pending-title {
    font-family: 'Unbounded', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .5rem;
}
.pending-sub {
    font-size: .85rem;
    color: var(--muted);
    line-height: 1.65;
    margin-bottom: 1rem;
}
.pending-timer {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--purple-l);
    color: var(--purple);
    border-radius: 100px;
    padding: .3rem .9rem;
    font-size: .78rem;
    font-weight: 600;
}

/* ── TOAST ── */
.toast-container { z-index: 9999; }

/* ── SPINNER ── */
.spin { animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.open-btn {
    width: 100%;
}

@media (min-width: 768px) {
    .open-btn {
        width: auto;
        white-space: nowrap;
    }
}

.accordion-button {
    font-weight: 600;
    border-radius: 12px;
    background: var(--purple-l);
    color: var(--purple);
}

.accordion-button:hover {
    background: var(--purple-d);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(107,79,160,.4);
    color: #fff;
}
.accordion-button:not(.collapsed) {
    background: var(--purple-d);
    color: #fff;
    box-shadow: none;
}
.accordion-button:focus {
    box-shadow: none;
    outline: none;
}

.accordion-body {
    font-size: 0.95rem;
    color: var(--muted);

}

.faq-btn {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(107,79,160,.08);
    color: var(--purple);
    text-decoration: none;
    font-weight: 500;
    transition: .2s;
}

.faq-btn:hover {
    background: var(--purple-d);
    color: #fff;
}


.admin-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: 0 2px 16px rgba(107,79,160,.06);
    margin-top: -1.5rem;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.users-table thead th {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    padding: .6rem .75rem;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.users-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.users-table tbody tr:last-child { border-bottom: none; }
.users-table tbody tr:hover { background: var(--bg-soft); }
.users-table td {
    padding: .65rem .75rem;
    vertical-align: middle;
}

.adj-edit-btn {
    background: var(--purple-l);
    color: var(--purple);
    border: 1px solid rgba(107,79,160,.2);
    border-radius: 8px;
    padding: .35rem .85rem;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}
.adj-edit-btn:hover { background: var(--purple); color: #fff; }

.search-input {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: .45rem .9rem;
    font-size: .85rem;
    outline: none;
    width: 100%;
    max-width: 280px;
    transition: border-color .2s;
}
.search-input:focus { border-color: var(--purple); }

.modal-dir-btn {
    flex: 1;
    padding: .55rem;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    background: #fff;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: all .2s;
}
.modal-dir-btn.active {
    border-color: var(--purple);
    background: var(--purple-l);
    color: var(--purple);
}

.modal-num-input {
    margin-top: .5rem;
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: .55rem .9rem;
    font-size: .95rem;
    font-weight: 600;
    outline: none;
    transition: border-color .2s;
}
.modal-num-input:focus { border-color: var(--purple); }

.unit-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.unit-btn {
    padding: .4rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: all .2s;
}
.unit-btn.active {
    border-color: var(--purple);
    background: var(--purple);
    color: #fff;
}

.modal-preview {
    margin-top: 1.25rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .75rem 1rem;
    font-weight: 700;
    font-size: .95rem;
    color: var(--purple);
    text-align: center;
}

.modal-cancel-btn {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: .55rem 1.2rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.modal-cancel-btn:hover { border-color: var(--purple); color: var(--purple); }

.modal-confirm-btn {
    background: var(--purple);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: .55rem 1.4rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.modal-confirm-btn:hover { background: var(--purple-d); }