/* ============================================
   IndexChecker Pro v2 — Premium Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Reset & Base ───────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #6c5ce7;
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-2: #111128;
    --bg-card: #161636;
    --bg-card-hover: #1c1c44;
    --bg-input: #1a1a3a;
    --bg-glass: rgba(22, 22, 54, 0.7);

    --border: #2a2a5a;
    --border-light: #3a3a6a;

    --text-primary: #e8e8f0;
    --text-secondary: #9898b8;
    --text-2: #9898b8;
    --text-muted: #6868a0;
    --text-dark: #111827;

    --accent: #6c5ce7;
    --accent-hover: #7d6ff0;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --accent-gradient: linear-gradient(135deg, #6c5ce7, #a29bfe);

    --success: #00cec9;
    --success-bg: rgba(0, 206, 201, 0.12);
    --danger: #ff6b6b;
    --danger-bg: rgba(255, 107, 107, 0.12);
    --warning: #ffc048;
    --warning-bg: rgba(255, 192, 72, 0.12);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* ── Auth Page ──────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(162, 155, 254, 0.06) 0%, transparent 50%),
        var(--bg-primary);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.auth-trust {
    margin: 0 0 20px;
    padding: 14px 16px;
    background: rgba(12, 12, 33, 0.9);
    border: 1px solid rgba(108, 92, 231, 0.22);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.auth-trust strong {
    display: block;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: #cfc8ff;
    margin-bottom: 6px;
}

.auth-trust p {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 28px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
}

.auth-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-glow);
    color: white;
    border-color: var(--accent-hover);
}

.btn-success {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #ff6b6b);
    color: white;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
}

.auth-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 16px;
    margin-bottom: 10px;
}

.auth-footer-links a,
.auth-footer-note {
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-footer-note a {
    color: #cfc8ff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.auth-error {
    background: var(--danger-bg);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--danger);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.turnstile-slot {
    display: none;
    justify-content: center;
    margin: 6px 0 18px;
}

.turnstile-slot.active {
    display: flex;
}

/* ── App Layout ─────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header span {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.nav-item .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details .name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-details .balance {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    background:
        radial-gradient(ellipse at 70% 10%, rgba(108, 92, 231, 0.04) 0%, transparent 50%),
        var(--bg-primary);
    min-height: 100vh;
}

/* ── Page Sections ──────────────────────────── */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ── Cards ──────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-card.accent .stat-value {
    color: var(--accent);
}

.stat-card.success .stat-value {
    color: var(--success);
}

.stat-card.warning .stat-value {
    color: var(--warning);
}

.stat-card.danger .stat-value {
    color: var(--danger);
}

/* ── Check Form ─────────────────────────────── */
.check-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
}

.check-form textarea {
    width: 100%;
    min-height: 180px;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.8;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}

.check-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.check-form textarea::placeholder {
    color: var(--text-muted);
}

.check-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.engine-select {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.engine-option {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
}

.engine-option.active {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.url-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: auto;
}

/* ── Progress Bar ───────────────────────────── */
.progress-container {
    display: none;
    margin: 24px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.progress-container.visible {
    display: block;
}

.progress-bar-track {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* ── Results Table ──────────────────────────── */
.results-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.dashboard-helper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.helper-card-body {
    padding: 20px 24px 24px;
}

.helper-copy {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 18px;
}

.package-gate-note {
    margin-bottom: 20px;
}

.package-gate-note strong {
    color: var(--text-primary);
}

.onboarding-steps {
    display: grid;
    gap: 12px;
}

.onboarding-step {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.onboarding-step.active {
    border-color: rgba(108, 92, 231, 0.55);
    box-shadow: 0 0 0 1px rgba(108, 92, 231, 0.2);
}

.onboarding-step strong {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
}

.onboarding-step span {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.inline-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.desktop-cta {
    margin-top: 18px;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(108, 92, 231, 0.35);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(10, 10, 26, 0.32));
}

.section-focus {
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.28);
    transition: box-shadow 0.2s ease;
}

[id^="balance-"] {
    scroll-margin-top: 16px;
}

.desktop-cta strong {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
}

.desktop-cta p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.branding-logo-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    margin-top: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
}

.branding-logo-preview img {
    width: 96px;
    height: 64px;
    object-fit: contain;
    border-radius: 10px;
    background: #ffffff;
    padding: 8px;
}

.branding-logo-preview strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.branding-logo-preview p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.pricing-grid {
    display: grid;
}

.price-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100%;
    transition: var(--transition);
}

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

.price-card.featured {
    border-color: rgba(108, 92, 231, 0.45);
    box-shadow: 0 0 0 1px rgba(108, 92, 231, 0.18);
}

.price-card.locked {
    opacity: 0.88;
}

.price-card.locked:hover {
    transform: none;
}

.price-amount {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.price-period {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.price-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.price-features {
    list-style: none;
    display: grid;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 18px;
    color: var(--text-secondary);
    font-size: 13px;
}

.price-features li {
    position: relative;
    padding-left: 18px;
}

.price-features li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
}

.form-input[type="file"] {
    padding: 10px 12px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.results-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.results-actions {
    display: flex;
    gap: 8px;
}

.results-table-wrapper {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 12px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.results-table th {
    background: var(--bg-input);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.results-table tr:hover {
    background: var(--bg-card-hover);
}

.results-table td a {
    color: var(--text-primary);
}

.results-table td a:hover {
    color: var(--accent);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-neutral {
    background: var(--bg-input);
    color: var(--text-secondary);
}

/* ── History ────────────────────────────────── */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.history-item .engine-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: var(--accent-glow);
    color: var(--accent);
    text-transform: uppercase;
}

.history-item .info {
    flex: 1;
}

.history-item .info .date {
    font-size: 13px;
    color: var(--text-secondary);
}

.history-item .info .summary {
    font-size: 14px;
    font-weight: 500;
    margin-top: 2px;
}

.history-item .stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

/* ── Transactions ───────────────────────────── */
.transaction-list {
    display: flex;
    flex-direction: column;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item .tx-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.transaction-item .tx-icon.topup {
    background: var(--success-bg);
}

.transaction-item .tx-icon.debit {
    background: var(--danger-bg);
}

.transaction-item .tx-info {
    flex: 1;
}

.transaction-item .tx-info .tx-desc {
    font-size: 14px;
    font-weight: 500;
}

.transaction-item .tx-info .tx-date {
    font-size: 12px;
    color: var(--text-muted);
}

.transaction-item .tx-amount {
    font-size: 16px;
    font-weight: 700;
}

.transaction-item .tx-amount.positive {
    color: var(--success);
}

.transaction-item .tx-amount.negative {
    color: var(--danger);
}

/* ── Rank Tracking ─────────────────────────── */
.rank-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.rank-project-list {
    display: grid;
    gap: 12px;
}

.rank-project-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.rank-project-item:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.rank-project-item.active {
    border-color: rgba(108, 92, 231, 0.55);
    box-shadow: 0 0 0 1px rgba(108, 92, 231, 0.16);
}

.rank-project-item-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.rank-project-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.rank-project-item-domain {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    word-break: break-word;
}

.rank-project-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.rank-project-meta {
    display: grid;
    gap: 10px;
}

.rank-project-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rank-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

.rank-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.rank-checkbox input {
    accent-color: var(--accent);
}

.rank-run-summary {
    display: grid;
    gap: 6px;
}

.rank-run-cost-copy {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.rank-inline-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rank-inline-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: var(--text-secondary);
}

.rank-progress-card .helper-card-body {
    display: grid;
    gap: 14px;
}

.rank-progress-track {
    width: 100%;
    height: 12px;
    background: var(--bg-input);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rank-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 999px;
    transition: width 0.3s ease;
    box-shadow: 0 0 24px rgba(108, 92, 231, 0.28);
}

.rank-keywords-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}

.rank-keywords-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.rank-keywords-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.rank-keywords-stack {
    display: grid;
    gap: 16px;
}

.rank-keywords-panel {
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(180deg, rgba(18, 16, 44, 0.85), rgba(12, 11, 30, 0.98));
}

.rank-keywords-panel-accent {
    border-color: rgba(108, 92, 231, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 30px rgba(10, 8, 28, 0.28);
}

.rank-keywords-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.rank-keywords-panel-head h4 {
    margin: 0;
    font-size: 15px;
    color: var(--text-primary);
}

.rank-keywords-mini {
    min-height: 120px;
}

.rank-chart-shell {
    min-height: 250px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(20, 18, 46, 0.88), rgba(12, 11, 30, 0.96));
    padding: 18px;
}

.rank-chart-empty {
    min-height: 214px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.rank-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
}

.rank-chart-metric {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.rank-chart-caption {
    font-size: 12px;
    color: var(--text-secondary);
}

.rank-chart-svg {
    width: 100%;
    height: 150px;
    overflow: visible;
    display: block;
}

.rank-chart-grid-line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}

.rank-chart-path {
    fill: none;
    stroke: #8b7bff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rank-chart-point {
    fill: #ffffff;
    stroke: #8b7bff;
    stroke-width: 3;
}

.rank-chart-labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
}

.rank-chart-labels span {
    font-size: 11px;
    color: var(--text-muted);
}

.rank-distribution-list {
    display: grid;
    gap: 12px;
}

.rank-distribution-row {
    display: grid;
    grid-template-columns: minmax(72px, 90px) 1fr auto;
    align-items: center;
    gap: 12px;
}

.rank-distribution-label,
.rank-distribution-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.rank-distribution-track {
    height: 10px;
    background: var(--bg-input);
    border-radius: 999px;
    overflow: hidden;
}

.rank-distribution-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--accent-gradient);
}

.rank-delta {
    font-weight: 700;
    font-size: 12px;
}

.rank-delta.positive {
    color: var(--success);
}

.rank-delta.negative {
    color: var(--danger);
}

.rank-delta.neutral {
    color: var(--text-muted);
}

.rank-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rank-inline-empty {
    padding: 24px 12px;
}

.rank-run-item {
    cursor: pointer;
    transition: var(--transition);
}

.rank-run-item:hover {
    background: var(--bg-card-hover);
}

.rank-run-item.active {
    box-shadow: inset 3px 0 0 rgba(108, 92, 231, 0.85);
    background: rgba(108, 92, 231, 0.08);
}

.rank-matrix-shell {
    width: 100%;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(108, 92, 231, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(13, 12, 33, 0.96), rgba(9, 8, 24, 1));
}

.rank-matrix-table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
}

.rank-matrix-table th,
.rank-matrix-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
    vertical-align: middle;
}

.rank-matrix-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(16, 14, 39, 0.98);
    backdrop-filter: blur(10px);
}

.rank-matrix-sticky {
    position: sticky;
    left: 0;
    z-index: 3;
    text-align: left !important;
    min-width: 260px;
    background: rgba(14, 13, 34, 0.98);
}

.rank-matrix-col-date {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.rank-matrix-col-meta {
    margin-top: 4px;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rank-matrix-keyword {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.rank-matrix-keyword-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.rank-matrix-cell {
    min-width: 70px;
    padding: 10px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rank-matrix-cell.top3 {
    background: linear-gradient(180deg, rgba(30, 214, 120, 0.35), rgba(13, 94, 55, 0.7));
    color: #dfffee;
}

.rank-matrix-cell.top10 {
    background: linear-gradient(180deg, rgba(90, 214, 255, 0.24), rgba(20, 96, 151, 0.62));
    color: #dff5ff;
}

.rank-matrix-cell.top50 {
    background: linear-gradient(180deg, rgba(116, 129, 255, 0.24), rgba(57, 66, 168, 0.64));
    color: #eef0ff;
}

.rank-matrix-cell.top100 {
    background: linear-gradient(180deg, rgba(164, 116, 255, 0.2), rgba(97, 53, 171, 0.62));
    color: #f3eaff;
}

.rank-matrix-cell.not-found {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}

.rank-matrix-cell.error {
    background: linear-gradient(180deg, rgba(255, 96, 124, 0.22), rgba(130, 24, 52, 0.66));
    color: #ffe5ec;
}

.rank-matrix-cell.running {
    background: linear-gradient(180deg, rgba(255, 193, 92, 0.22), rgba(120, 73, 22, 0.62));
    color: #fff1d5;
}

@media (max-width: 768px) {
    .rank-matrix-sticky {
        min-width: 190px;
    }

    .rank-matrix-cell {
        min-width: 60px;
        padding: 8px 6px;
    }
}

/* ── Toast / Notifications ──────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: white;
    z-index: 9999;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.success {
    background: linear-gradient(135deg, #00b894, #00cec9);
}

.toast.error {
    background: linear-gradient(135deg, #e74c3c, #ff6b6b);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Loading Spinner ────────────────────────── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 26, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    z-index: 10;
}

/* ── Empty State ────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 14px;
}

/* ── Generic Modal ─────────────────────────── */
.admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 26, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
}

/* ── Mobile Menu Toggle ─────────────────────── */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 64px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .check-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .url-count {
        margin-left: 0;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-item .stats {
        margin-top: 8px;
    }

    .helper-card-body {
        padding: 18px;
    }

    .branding-logo-preview {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   ЮРИДИЧЕСКИЕ СТРАНИЦЫ (Privacy, Terms)
   ========================================== */

.legal-header {
    background: var(--primary);
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.legal-header .logo {
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.3s;
}

.legal-header .logo:hover {
    opacity: 0.8;
}

/* Основной контент */
.legal-content {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
    line-height: 1.8;
}

.legal-content .container {
    background: #f8fafc;
    color: var(--text-dark);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.legal-content h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.legal-content .subtitle {
    font-size: 18px;
    color: #4b5563;
    margin-bottom: 12px;
}

.legal-date {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 40px;
    font-style: italic;
}

.legal-section {
    margin-bottom: 40px;
}

.legal-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    padding-top: 10px;
    border-top: 2px solid #E5E7EB;
}

.legal-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 14px;
}

.legal-section p {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.legal-section ul,
.legal-section ol {
    margin: 15px 0;
    padding-left: 25px;
}

.legal-section ul li,
.legal-section ol li {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.7;
}

.legal-section a {
    color: var(--primary);
    text-decoration: underline;
}

.legal-section a:hover {
    color: #1E40AF;
}

.legal-section strong {
    font-weight: 700;
    color: var(--text-dark);
}

.legal-intro {
    font-size: 18px;
    color: var(--text-secondary);
    margin-top: 20px;
}

.support-card {
    text-align: left;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
}

.support-card h3,
.support-card li,
.support-card strong {
    color: var(--text-primary);
}

.support-card ul {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.support-card li {
    margin-bottom: 10px;
}

.support-card a {
    color: #c9c5ff;
}

.support-card a:hover {
    color: #e3e1ff;
}

/* Футер юридических страниц */
.legal-footer {
    background: #F9FAFB;
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid #E5E7EB;
    margin-top: 80px;
}

.legal-footer p {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Адаптив для мобилки */
@media (max-width: 768px) {
    .legal-content {
        margin: 40px auto;
    }

    .legal-content .container {
        padding: 28px 20px;
    }

    .legal-content h1 {
        font-size: 28px;
    }

    .legal-section h2 {
        font-size: 20px;
    }

    .legal-section p,
    .legal-section ul li,
    .legal-section ol li {
        font-size: 15px;
    }
}

.affiliate-link-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.affiliate-note {
    margin-top: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.affiliate-commission-row {
    align-items: center;
}

@media (max-width: 820px) {
    .affiliate-link-grid,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}
