/* =========================================================
   FTC.ink — Global Stylesheet
   ========================================================= */

:root {
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;

    --color-primary: #4f46e5;
    --color-primary-dark: #4338ca;
    --color-primary-light: #eef2ff;

    --color-accent: #10b981;
    --color-accent-light: #ecfdf5;
    --color-danger: #ef4444;
    --color-danger-light: #fef2f2;
    --color-warning: #f59e0b;
    --color-warning-light: #fffbeb;

    --color-navy: #0f172a;
    --color-navy-light: #1e293b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.18);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 1160px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

img, svg {
    display: block;
    max-width: 100%;
}

.icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-dark);
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

main {
    flex: 1;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
        transform 0.1s ease, box-shadow 0.15s ease;
    text-decoration: none;
    line-height: 1.2;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
}

.btn-outline:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--color-warning);
    color: #fff;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-sm {
    padding: 7px 16px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================================================
   Navbar
   ========================================================= */

.navbar {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.logo-mark {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.navbar-brand:hover {
    color: #fff;
}

.navbar-brand .dot {
    color: var(--color-accent);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-links a {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 0.92rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease;
}

.navbar-links a:hover,
.navbar-links a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.navbar-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

/* =========================================================
   Hero / Sections
   ========================================================= */

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    color: #fff;
    padding: 100px 0 110px;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 25%, rgba(99, 102, 241, 0.35), transparent 42%),
        radial-gradient(circle at 82% 5%, rgba(16, 185, 129, 0.18), transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(99, 102, 241, 0.12), transparent 50%);
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 20px;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.7);
    max-width: 620px;
    margin: 0 auto 38px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 50px;
}

.section-header .eyebrow {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.section-header h2 {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

.section-header p {
    color: var(--color-text-muted);
    font-size: 1.05rem;
}

.section-alt {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

/* =========================================================
   Feature / Info Cards
   ========================================================= */

.grid {
    display: grid;
    gap: 24px;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #d8defa;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.card-icon.accent {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.step-card {
    text-align: left;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: var(--color-navy);
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

/* =========================================================
   Auth Pages (login / signup)
   ========================================================= */

.auth-page {
    min-height: calc(100vh - 69px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.3), transparent 42%),
        radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.15), transparent 40%);
    pointer-events: none;
}

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 44px 40px;
    position: relative;
    z-index: 1;
}

.auth-card .auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-card .auth-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.auth-card .auth-header p {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* =========================================================
   Forms
   ========================================================= */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.97rem;
    font-family: inherit;
    background: #fff;
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 6px;
}

.input-group {
    display: flex;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-addon {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-right: none;
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* =========================================================
   Alerts / Flash messages
   ========================================================= */

.alert {
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--color-accent-light);
    border-color: #b9ecdb;
    color: #047857;
}

.alert-error {
    background: var(--color-danger-light);
    border-color: #fecaca;
    color: #b91c1c;
}

.alert-info {
    background: var(--color-primary-light);
    border-color: #c7d2fe;
    color: var(--color-primary-dark);
}

.alert-warning {
    background: var(--color-warning-light);
    border-color: #fde68a;
    color: #92400e;
}

/* =========================================================
   Dashboard layout
   ========================================================= */

.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 69px);
}

.dashboard-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 24px 0;
}

.dashboard-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px;
}

.dashboard-sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.92rem;
    border-radius: var(--radius-sm);
}

.dashboard-sidebar a:hover {
    color: var(--color-text);
    background: var(--color-bg);
}

.dashboard-sidebar a.active {
    color: var(--color-primary-dark);
    background: var(--color-primary-light);
    font-weight: 600;
}

.dashboard-main {
    flex: 1;
    padding: 36px;
    min-width: 0;
}

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

.dashboard-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.dashboard-header p {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    margin-top: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
}

.panel h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* =========================================================
   Tables
   ========================================================= */

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table th,
table td {
    text-align: left;
    padding: 13px 14px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

table th {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

table tbody tr:hover {
    background: var(--color-bg);
}

.cell-url {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-muted);
}

.actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.short-link-cell a {
    font-weight: 600;
    color: var(--color-text);
}

.copy-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    cursor: pointer;
    margin-top: 2px;
}

.copy-link:hover {
    color: var(--color-primary);
}

.copy-link .icon {
    width: 14px;
    height: 14px;
}

/* =========================================================
   Badges
   ========================================================= */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-active {
    background: var(--color-accent-light);
    color: #047857;
}

.badge-paused {
    background: var(--color-warning-light);
    color: #92400e;
}

.badge-admin {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.badge-user {
    background: #f1f5f9;
    color: var(--color-text-muted);
}

.badge-disabled {
    background: var(--color-danger-light);
    color: #b91c1c;
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
    background: var(--color-navy);
    color: rgba(255, 255, 255, 0.65);
    padding: 56px 0 28px;
    margin-top: auto;
}

.site-footer .footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.site-footer h4 {
    color: #fff;
    font-size: 0.92rem;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.site-footer ul {
    list-style: none;
}

.site-footer li {
    margin-bottom: 10px;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.site-footer a:hover {
    color: #fff;
}

.site-footer .footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

.site-footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 24px;
    font-size: 0.85rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
}

/* =========================================================
   Static / legal pages
   ========================================================= */

.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 64px 24px;
}

.legal-page h1 {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.legal-page .updated {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 36px;
}

.legal-page h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 32px 0 12px;
    letter-spacing: -0.01em;
}

.legal-page p,
.legal-page li {
    color: var(--color-text-muted);
    margin-bottom: 14px;
    font-size: 0.97rem;
}

.legal-page ul,
.legal-page ol {
    padding-left: 22px;
    margin-bottom: 14px;
}

/* =========================================================
   Misc
   ========================================================= */

.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--color-text-muted); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

.empty-state .icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 14px;
    color: var(--color-border);
    stroke-width: 1.5;
}

/* =========================================================
   Responsive
   ========================================================= */

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

    .site-footer .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-sidebar {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: flex;
    }

    .navbar-links {
        position: absolute;
        top: 69px;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.97);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: 0 12px;
    }

    .navbar-links.open {
        max-height: 480px;
        padding: 10px 12px;
    }

    .navbar-links a {
        padding: 13px 14px;
    }

    .navbar-actions {
        display: none;
        margin-left: 0;
    }

    .navbar-links.open .navbar-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 8px 2px 12px;
        gap: 10px;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .site-footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        text-align: center;
    }

    .site-footer .footer-brand,
    .site-footer h4 {
        margin-top: 8px;
    }

    .site-footer .footer-brand {
        justify-content: center;
    }

    .dashboard-layout {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        padding: 10px 12px;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .dashboard-sidebar nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0;
    }

    .dashboard-sidebar a {
        white-space: nowrap;
    }

    .dashboard-main {
        padding: 22px 18px;
    }

    .auth-card {
        padding: 36px 26px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 64px 0 72px;
    }

    .section {
        padding: 56px 0;
    }

    .cell-url {
        max-width: 140px;
    }
}
