/*
Theme Name: OtoSurf
Theme URI: https://example.com/otosurf
Author: OtoSurf
Description: A premium WordPress theme with membership, user dashboard, admin panel, credits system and an auto-surf that runs in a new browser tab.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: otosurf
*/

:root {
  --ink: #0c1a3d;
  --ink-2: #33415f;
  --muted: #67769a;
  --blue: #2357e6;
  --blue-600: #1a45c2;
  --navy: #0d2156;
  --navy-2: #163177;
  --soft: #edf2ff;
  --bg: #f5f7fb;
  --white: #ffffff;
  --line: #e3e8f2;
  --gold: #f2b705;
  --gold-soft: #fff6d9;
  --ok: #12804d;
  --ok-soft: #e5f5ec;
  --warn: #8f5b00;
  --warn-soft: #fdf3dc;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(12, 26, 61, .04), 0 6px 20px rgba(12, 26, 61, .05);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-600); }
:focus-visible { outline: 3px solid #9db8ff; outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 800; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: 2rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.num, .stat-value, .credit-big, .sbar-timer { font-variant-numeric: tabular-nums; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.main { padding-top: 32px; padding-bottom: 64px; min-height: calc(100vh - 170px); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Top bar ---------- */
.topbar { background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 1.05rem; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { padding: 8px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.active { color: var(--blue); background: var(--soft); }
.nav .nav-credits { color: var(--ink); font-weight: 700; padding: 8px 12px; font-size: .9rem; }
.nav .nav-credits span { color: var(--muted); font-weight: 600; }
.nav a.nav-cta { background: var(--blue); color: #fff; margin-left: 6px; }
.nav a.nav-cta:hover { background: var(--blue-600); color: #fff; }
.nav-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 11px; font-size: 1.1rem; cursor: pointer; color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: .9rem; padding: 26px 0; }
.footer-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; background: var(--blue); color: #fff; line-height: 1.2; transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--blue-600); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-light:hover { background: var(--soft); color: var(--ink); border-color: #d3dcef; }
.btn-danger { background: var(--bad); }
.btn-danger:hover { background: #8f1c13; }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: #0d6a3f; }
.btn-sm { padding: 6px 11px; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; border-radius: 12px; }
.btn-block { width: 100%; }

label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
textarea { font: .85rem/1.5 ui-monospace, Menlo, Consolas, monospace; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px rgba(35, 87, 230, .14); }
.field { margin-bottom: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 4px; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.inline-form { display: inline; margin: 0; }
.row-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-form input { width: auto; flex: 1 1 140px; padding: 7px 10px; border-radius: 8px; }

/* ---------- Notices ---------- */
.notice { padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; border: 1px solid; font-size: .95rem; }
.notice-ok { background: var(--ok-soft); border-color: #bfe3cf; color: var(--ok); }
.notice-error { background: var(--bad-soft); border-color: #f5c6c1; color: var(--bad); }
.notice-warn { background: var(--warn-soft); border-color: #f0d9a6; color: var(--warn); }

/* ---------- Cards ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 24px; margin-bottom: 22px; box-shadow: var(--shadow); }
.panel h2 { margin-bottom: 1em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.grid-2 > .panel { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-value { font-size: 1.7rem; font-weight: 800; color: var(--ink); line-height: 1.15; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: .88rem; font-weight: 600; margin-top: 2px; }

/* ---------- Dashboard surf hero (the signature element) ---------- */
.surf-hero { background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 30px; margin-bottom: 22px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; position: relative; overflow: hidden; }
.surf-hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 340px; height: 340px; border-radius: 50%; border: 48px solid rgba(255, 255, 255, .05); pointer-events: none; }
.surf-hero h1, .surf-hero h2 { color: #fff; }
.surf-hero-hello { color: #b9c8ef; font-weight: 600; margin-bottom: 4px; }
.surf-hero h1 { font-size: 1.9rem; margin-bottom: .35em; }
.surf-rule { color: #c9d5f5; font-size: .95rem; max-width: 52ch; margin-bottom: 20px; }
.surf-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.surf-hero .btn-surf { background: #fff; color: var(--navy); padding: 15px 30px; font-size: 1.1rem; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.surf-hero .btn-surf:hover { background: var(--soft); color: var(--navy); }
.surf-hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.surf-hero .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.surf-state { margin-top: 16px; font-size: .92rem; color: #dbe4fb; }
.surf-current { margin-top: 4px; font-size: .85rem; color: #aebee8; word-break: break-all; }

.wallet { background: var(--navy-2); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--r); padding: 22px; align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; position: relative; z-index: 1; }
.wallet-label { color: #b9c8ef; font-size: .85rem; font-weight: 700; }
.credit-big { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.credit-sub { color: #b9c8ef; font-size: .88rem; }
.bonus-head { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 700; margin-bottom: 8px; }
.bonus-head span:last-child { color: var(--gold); }
.bonus-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.bonus-bar span { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .4s ease; }
.bonus-note { color: #b9c8ef; font-size: .82rem; margin-top: 8px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 700; font-size: .8rem; background: #fafbfe; }
tr:last-child td { border-bottom: 0; }
td.url { max-width: 340px; word-break: break-all; }
.num { text-align: right; }
.plus { color: var(--ok); font-weight: 700; }
.minus { color: var(--bad); font-weight: 700; }
.empty { color: var(--muted); padding: 10px 0; margin: 0; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-approved, .badge-active { background: var(--ok-soft); color: var(--ok); }
.badge-rejected, .badge-inactive { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--soft); color: var(--blue-600); }
.badge-gold { background: var(--gold-soft); color: #8a6400; }

/* ---------- Admin tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 11px 16px; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--blue); border-bottom-color: var(--blue); }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.subtabs a { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; font-weight: 600; background: #fff; }
.subtabs a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager { display: flex; gap: 10px; margin-top: 16px; align-items: center; color: var(--muted); }

/* ---------- Auth ---------- */
.auth { max-width: 440px; margin: 24px auto; }
.auth .panel { padding: 34px; }
.auth h1 { font-size: 1.6rem; }
.auth-sub { color: var(--muted); margin-top: -6px; }
.auth-foot { text-align: center; color: var(--muted); margin-top: 16px; }
.rule-note { background: var(--soft); border-radius: 10px; padding: 11px 14px; margin-bottom: 20px; font-size: .9rem; color: var(--ink-2); }

/* ---------- Home ---------- */
.hero { padding: 36px 0 30px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 3.1rem; line-height: 1.05; letter-spacing: -.035em; max-width: 13ch; }
.hero p { font-size: 1.12rem; color: var(--ink-2); max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.hero-demo { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 24px 60px rgba(12, 26, 61, .12); }
.hero-demo-bar { background: var(--navy); color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; font-size: .9rem; font-weight: 600; }
.hero-demo-bar strong { background: rgba(255, 255, 255, .12); padding: 2px 10px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.hero-demo-progress { height: 4px; background: var(--soft); }
.hero-demo-progress span { display: block; width: 45%; height: 100%; background: var(--blue); }
.hero-demo-body { padding: 22px; display: grid; gap: 12px; }
.hero-demo-body i { display: block; height: 12px; border-radius: 99px; background: var(--soft); }
.hero-demo-body i:nth-child(1) { width: 60%; height: 18px; background: #dfe7fb; }
.hero-demo-body i:nth-child(2) { width: 92%; }
.hero-demo-body i:nth-child(3) { width: 78%; }
.hero-demo-body i:nth-child(4) { width: 85%; }
.hero-demo-foot { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); font-weight: 600; }
.hero-demo-foot b { color: var(--ok); }

.rule-band { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 30px 34px; margin: 10px 0 22px; }
.rule-big { font-size: 2.3rem; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; white-space: nowrap; }
.rule-band p { margin: 0 0 .4em; max-width: 64ch; color: #dbe4fb; }
.rule-band p strong { color: #fff; }
.rule-band p:last-child { margin: 0; }

.section-title { margin: 40px 0 16px; font-size: 1.5rem; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; counter-increment: s; box-shadow: var(--shadow); }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--soft); color: var(--blue); font-weight: 800; margin-bottom: 12px; }
.steps p { color: var(--muted); margin: 0; }
.cta-band { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px 34px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 36px; box-shadow: var(--shadow); }
.cta-band h2 { margin: 0; font-size: 1.4rem; }
.cta-band p { margin: 4px 0 0; color: var(--muted); }

.content { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 36px; max-width: 840px; box-shadow: var(--shadow); }
.content h2 { margin-top: 1.5em; }
.content li { margin-bottom: .4em; }

/* Ad slots */
.ad-slot { margin: 30px auto; max-width: 970px; text-align: center; overflow: hidden; }
.ad-label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.ad-body { display: flex; justify-content: center; }
.ad-body img, .ad-body iframe { max-width: 100%; height: auto; }
.ad-empty { border: 2px dashed var(--line); border-radius: var(--r); padding: 22px; font-size: .9rem; }

/* ---------- Surf tab ---------- */
body.os-surf-body { background: var(--bg); height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.sbar { display: flex; align-items: center; gap: 14px; padding: 9px 16px; background: var(--navy); color: #fff; flex-wrap: wrap; }
.sbar .brand { color: #fff; font-size: 1rem; }
.sbar .brand-mark { background: #fff; color: var(--navy); width: 28px; height: 28px; border-radius: 8px; }
.sbar-site { flex: 1 1 200px; min-width: 0; }
.sbar-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbar-url { font-size: .8rem; color: #b9c8ef; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbar-url a { color: #b9c8ef; }
.sbar-timer { font-size: 1.35rem; font-weight: 800; min-width: 3.2ch; text-align: center; background: rgba(255, 255, 255, .12); border-radius: 10px; padding: 2px 10px; }
.sbar-rule { font-size: .8rem; color: #b9c8ef; white-space: nowrap; }
.sbar-points { font-size: .88rem; white-space: nowrap; color: #dbe4fb; }
.sbar-points strong { color: #fff; }
.sbar-bonus { font-size: .8rem; white-space: nowrap; color: var(--gold); font-weight: 700; }
.sbar .btn { background: #fff; color: var(--navy); }
.sbar .btn:hover { background: var(--soft); }
.sbar .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.sbar .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sbar-progress { height: 4px; background: #d8e2fb; }
.sbar-progress span { display: block; height: 100%; width: 0; background: var(--blue); }
.smsg { padding: 9px 16px; font-size: .9rem; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid #f0d9a6; }
.smsg[hidden] { display: none; }
.stoast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; border: 1px solid rgba(255, 255, 255, .15); padding: 12px 20px; border-radius: 12px; font-weight: 700; box-shadow: 0 12px 30px rgba(12, 26, 61, .3); z-index: 50; }
.stoast b { color: var(--gold); }
.stoast[hidden] { display: none; }
.sframe-wrap { flex: 1; position: relative; }
.sframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.sempty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
.sempty[hidden] { display: none; }
.swin { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.swin[hidden] { display: none; }
.swin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px; max-width: 470px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.swin-url { color: var(--muted); font-size: .9rem; word-break: break-all; }
.swin-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.swin-actions button[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media (max-width: 900px) {
  .grid-2, .hero, .surf-hero { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.3rem; }
  .rule-band { grid-template-columns: 1fr; gap: 10px; padding: 24px; }
  .rule-big { font-size: 1.9rem; }
  .sbar-rule { display: none; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px 16px; box-shadow: var(--shadow); }
  .nav a.nav-cta { margin-left: 0; text-align: center; }
  body.nav-open .nav { display: flex; }
  .surf-hero { padding: 22px; }
  .surf-hero .btn-surf { width: 100%; }
  .credit-big { font-size: 2.2rem; }
  .sbar { gap: 8px 10px; padding: 8px 12px; }
  .sbar-timer { font-size: 1.15rem; }
  .sbar-bonus { display: none; }
}
