@import url('https://fonts.googleapis.com/css?family=Lato:300,400,700&display=swap');
@import url('https://fonts.cdnfonts.com/css/century-gothic?styles=24895,24898,24896,24897');

:root {
    --primary: #014dae;
    --primary-hover: #359fcc;
    --navy: #0b213d;
    --teal: #5bdde4;
    --muted: #5a7a9a;
    --border: #dde8f0;
    --good-bg: #dcf5e8; --good-fg: #146c43;
    --mid-bg: #fff3cd; --mid-fg: #8a6400;
    --bad-bg: #ffe0e0; --bad-fg: #9c1c1c;
    --info-bg: #e5eef2; --info-fg: #3a5a68;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    min-height: 100vh;
    font-family: "Century Gothic", "Lato", sans-serif;
    background: radial-gradient(circle, #aadee9, #b2dfed, #bbdff0, #c4dff2, #cde0f3);
    background-attachment: fixed;
    color: var(--navy);
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

.card {
    background: #ffffffcc;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(11, 33, 61, 0.15);
}
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
}
h1 {
    font-size: 26px;
    margin-bottom: 8px;
    text-align: center;
}
p.subtitle {
    text-align: center;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 10px;
}
label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    margin-top: 16px;
}
input[type=text],
input[type=email],
input[type=password] {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
}
button, .btn {
    font-family: inherit;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    padding: 12px 20px;
    border: none;
    border-radius: 1000px;
    background: var(--primary);
    transition: 0.2s;
    cursor: pointer;
}
button:hover, .btn:hover {
    background: var(--primary-hover);
}
button.btn { margin-top: 24px; width: 100%; }
.error {
    background: var(--bad-bg);
    color: var(--bad-fg);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    margin-top: 16px;
}
.switch-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
}
.switch-link a {
    font-weight: 600;
    text-decoration: none;
}
.switch-link a:hover { text-decoration: underline; }

.google-btn { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; margin-top:20px; padding:11px 20px; border:2px solid var(--border); border-radius:1000px; background:#fff; color:#333; font-family:inherit; font-weight:700; font-size:14px; text-decoration:none; }
.google-btn:hover { background:#f5f8fa; }
.divider { display:flex; align-items:center; gap:10px; margin-top:20px; font-size:12px; color:#888; }
.divider::before, .divider::after { content:""; flex:1; height:1px; background:var(--border); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.toggle-password {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; padding: 0; cursor: pointer;
    font-size: 12px; font-weight: 700; color: var(--primary); font-family: inherit;
}
.forgot-link { display: block; text-align: right; font-size: 12px; text-decoration: none; margin-top: 8px; }
.forgot-link:hover { text-decoration: underline; }

/* ── Top navigation ── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
    background: #ffffff40;
    flex-wrap: wrap;
    gap: 10px;
}
.brand-group { display: flex; align-items: center; gap: 10px; }
.navbar-logo { height: 32px; width: auto; display: block; }
.brand { font-weight: 700; font-size: 18px; color: var(--navy); }
.navbar-actions { display: flex; align-items: center; gap: 10px; }
.nav-btn, .topbar a.logout {
    color: var(--navy); font-size: 13px; font-weight: 600; text-decoration: none;
    border: 2px solid var(--navy); padding: 6px 16px; border-radius: 1000px;
}
.nav-btn:hover, .topbar a.logout:hover { background: var(--navy); color: #fff; }

.dash-content { flex: 1; padding: 40px 30px; max-width: 1100px; margin: 0 auto; width: 100%; }
.back-link { display: inline-block; margin-top: 20px; font-size: 13px; text-decoration: none; font-weight: 600; }

/* ── Dashboard, site list ── */
.add-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.add-form input { flex: 1; min-width: 200px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); font-family: inherit; }
.add-form button { padding: 10px 20px; margin-top: 0; width: auto; }

.site-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
.site-row:last-child { border-bottom: none; }
.site-url { font-weight: 700; font-size: 15px; word-break: break-all; }
.site-label { font-size: 12px; color: var(--muted); }
.scores { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.score-pill { padding: 6px 14px; border-radius: 1000px; font-size: 13px; font-weight: 700; text-decoration: none; }
.score-good { background: var(--good-bg); color: var(--good-fg); }
.score-mid { background: var(--mid-bg); color: var(--mid-fg); }
.score-bad { background: var(--bad-bg); color: var(--bad-fg); }

.scan-btn {
    font-size: 12px; padding: 6px 16px; border: 2px solid var(--navy); border-radius: 1000px;
    background: #fff; color: var(--navy); cursor: pointer; font-weight: 700; font-family: inherit; text-decoration: none; display: inline-block;
}
.scan-btn:hover { background: var(--navy); color: #fff; }
.empty { font-size: 14px; color: var(--muted); padding: 20px 0; }

/* ── Score summary boxes, used on results, admin scan, compare ── */
.summary { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.summary-box { flex: 1; min-width: 130px; text-align: center; padding: 20px; border-radius: 16px; }
.summary-box .num { font-size: 32px; font-weight: 700; }
.summary-box .lbl { font-size: 12px; margin-top: 4px; }

/* ── Top fixes / issue cards ── */
.top-fixes { margin-top: 30px; background: #fff8e8; border-radius: 16px; padding: 20px; }
.top-fixes h2 { font-size: 16px; margin-bottom: 14px; }
.fix-card, .issue-card { background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.fix-card:last-child { margin-bottom: 0; }
.fix-title, .issue-title { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.impact-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 8px; border-radius: 1000px; font-weight: 700; }
.impact-high { background: var(--bad-bg); color: var(--bad-fg); }
.impact-medium { background: var(--mid-bg); color: var(--mid-fg); }
.impact-low { background: var(--info-bg); color: var(--info-fg); }
.fix-why, .issue-detail { font-size: 13px; color: #333; margin-top: 6px; }
.fix-how { font-size: 13px; color: var(--good-fg); margin-top: 6px; font-weight: 600; }
.issue-urls { font-size: 12px; color: var(--muted); margin-top: 6px; }
.issue-urls div { word-break: break-all; }

/* ── Checklist ── */
.check-section { margin-top: 30px; }
.check-section h2 { font-size: 16px; margin-bottom: 10px; }
.check-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.check-row:last-child { border-bottom: none; }
.check-head { display: flex; align-items: flex-start; gap: 10px; }
.check-icon { font-weight: 700; width: 20px; flex-shrink: 0; }
.pass .check-icon { color: var(--good-fg); }
.fail .check-icon { color: var(--bad-fg); }
.check-label { font-weight: 700; font-size: 14px; }
.check-detail { font-size: 13px; color: #444; }
.check-extra { margin-left: 30px; margin-top: 6px; }
.check-extra .fix-why, .check-extra .fix-how { margin-top: 4px; }

/* ── Review request CTA ── */
.review-cta { margin-top: 30px; background: var(--navy); border-radius: 16px; padding: 24px; color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.review-cta h2 { font-size: 16px; margin-bottom: 4px; }
.review-cta p { font-size: 13px; color: #cfe0ea; }
.review-cta button { background: #fff; color: var(--navy); white-space: nowrap; margin-top: 0; width: auto; }
.review-cta button:hover { background: var(--info-bg); }
.review-success { margin-top: 20px; background: var(--good-bg); color: var(--good-fg); padding: 14px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; }

/* ── Deep scan status ── */
.status-pill { display: inline-block; padding: 6px 16px; border-radius: 1000px; font-size: 13px; font-weight: 700; margin-top: 10px; }
.status-queued { background: var(--info-bg); color: var(--info-fg); }
.status-running { background: var(--mid-bg); color: var(--mid-fg); }
.status-done { background: var(--good-bg); color: var(--good-fg); }
.status-failed { background: var(--bad-bg); color: var(--bad-fg); }

/* ── Tables, wrap in <div class="table-scroll"> so wide tables scroll instead of squeezing on mobile ── */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
select { font-family: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); }
.status-btn { font-family: inherit; padding: 4px 10px; border-radius: 6px; border: none; background: var(--navy); color: #fff; cursor: pointer; font-size: 12px; margin-top: 0; width: auto; }

/* ── Billing plans ── */
.plans { display: flex; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.plan-col { flex: 1; min-width: 260px; background: #fff; border-radius: 16px; padding: 24px; border: 2px solid transparent; }
.plan-col.current { border-color: var(--good-fg); }
.plan-name { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.current-tag { display: inline-block; background: var(--good-bg); color: var(--good-fg); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 1000px; margin-left: 8px; text-transform: none; letter-spacing: 0; }
.plan-price { font-size: 30px; font-weight: 700; color: var(--navy); margin-top: 8px; }
.plan-price span { font-size: 13px; font-weight: 400; color: var(--muted); }
ul.features { margin: 16px 0; padding-left: 20px; font-size: 14px; color: #333; }
ul.features li { margin-bottom: 6px; }
.expiry-note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.plan-col form { margin-top: 14px; }
.plan-col button { margin-top: 0; width: auto; padding-left: 24px; padding-right: 24px; }

/* ── Admin scan owner box ── */
.owner-box { background: var(--info-bg); border-radius: 12px; padding: 14px 18px; margin-top: 16px; font-size: 13px; }

/* ── Chart / history ── */
.chart-box { background: #fff; border-radius: 16px; padding: 24px; margin-top: 20px; }

/* ── Compare ── */
.compare-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.compare-form input { flex: 1; min-width: 220px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); font-family: inherit; }
.compare-form button { margin-top: 0; width: auto; }
.compare-cols { display: flex; gap: 20px; margin-top: 24px; flex-wrap: wrap; }
.compare-col { flex: 1; min-width: 260px; background: #fff; border-radius: 16px; padding: 20px; }
.compare-col h3 { font-size: 15px; margin-bottom: 10px; word-break: break-all; }
.compare-col .summary-box { min-width: 70px; padding: 12px; }
.compare-col .summary-box .num { font-size: 22px; }
.compare-col .summary-box .lbl { font-size: 10px; }

/* ── Mobile ── */
@media (max-width: 640px) {
    .topbar { padding: 12px 16px; }
    .brand { font-size: 15px; }
    .navbar-logo { height: 26px; }
    .nav-btn, .topbar a.logout { font-size: 12px; padding: 5px 12px; }

    .dash-content { padding: 20px 14px; }
    .card { padding: 24px 18px; }
    h1 { font-size: 21px; }

    .auth-wrap { padding: 14px; }
    .auth-card { max-width: 100%; }

    .site-row { flex-direction: column; align-items: flex-start; }
    .scores { width: 100%; }

    .summary, .plans, .compare-cols { flex-direction: column; }
    .summary-box, .plan-col, .compare-col { min-width: 100%; }

    .add-form, .compare-form { flex-direction: column; }
    .add-form input, .compare-form input, .add-form button, .compare-form button { width: 100%; }

    .review-cta { flex-direction: column; align-items: flex-start; }
    .review-cta button { width: 100%; }

    table { font-size: 12px; }
    th, td { padding: 6px 8px; }
}