/* =========================================================
   OneHandle — Global CSS  (No build step needed)
   Design tokens matching the original Next.js app
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Design Tokens ──────────────────────────────────────── */
:root {
  --background: #fafafa;
  --foreground: #18181b;
  --card: #ffffff;
  --card-foreground: #18181b;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --accent: #2563eb;
  --accent-foreground: #ffffff;
  --ring: #2563eb;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow-soft: 0 1px 2px #0000000a, 0 8px 24px -8px #00000014;
}

html.dark {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #18181b;
  --card-foreground: #fafafa;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --border: #27272a;
  --accent: #3b82f6;
  --danger: #f87171;
  --success: #4ade80;
  --shadow-soft: 0 1px 2px #0000004d, 0 8px 24px -8px #0009;
}

/* ── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  min-height: 100vh;
  margin: 0;
  transition: background-color 0.2s, color 0.2s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Custom Utilities ────────────────────────────────────── */
.bg-background   { background-color: var(--background) !important; }
.bg-card         { background-color: var(--card) !important; }
.bg-muted        { background-color: var(--muted) !important; }
.text-foreground { color: var(--foreground) !important; }
.text-muted-foreground { color: var(--muted-foreground) !important; }
.text-accent     { color: var(--accent) !important; }
.text-danger     { color: var(--danger) !important; }
.text-success    { color: var(--success) !important; }
.border-border   { border-color: var(--border) !important; }

/* ── Card ─────────────────────────────────────────────────── */
.oh-card {
  background-color: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
}

/* ── Primary Button ──────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: opacity 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-primary:hover  { opacity: 0.88; transform: translateY(-1px); color: #fff; }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Gradient Button ─────────────────────────────────────── */
.btn-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #059669 100%);
  color: #fff;
  transition: opacity 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-gradient:hover  { opacity: 0.88; transform: translateY(-1px); color: #fff; }
.btn-gradient:active { transform: translateY(0); }
.btn-gradient.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-gradient:disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

/* ── Secondary Button ────────────────────────────────────── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--card);
  color: var(--foreground);
  transition: background-color 0.15s, transform 0.15s;
  text-decoration: none;
}
.btn-secondary:hover { background-color: var(--muted); color: var(--foreground); transform: translateY(-1px); }

/* ── Floating Label Input ─────────────────────────────────── */
.oh-input-wrap {
  position: relative;
  display: block;
}
.oh-input-wrap label {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: var(--muted-foreground);
  pointer-events: none;
  transition: top 0.15s, font-size 0.15s, color 0.15s;
  background: transparent;
  z-index: 1;
  white-space: nowrap;
  max-width: calc(100% - 3rem);
  overflow: hidden;
  text-overflow: ellipsis;
}
.oh-input-wrap input:focus ~ label,
.oh-input-wrap input:not(:placeholder-shown) ~ label {
  top: 0.5rem;
  font-size: 0.7rem;
  color: var(--accent);
  max-width: 100%;
}
/* label is AFTER input in HTML — use ~ sibling selector */
.oh-input {
  width: 100%;
  padding: 1.35rem 2.75rem 0.45rem 0.875rem;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  color: var(--foreground);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.oh-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.oh-input::placeholder { color: transparent; }

/* Plain input (no floating label — shows placeholder normally) */
.oh-input-plain {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  color: var(--foreground);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.oh-input-plain:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.oh-input-plain::placeholder { color: var(--muted-foreground); }

/* Error state */
.oh-input-wrap.oh-input-error .oh-input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent);
}
.oh-input-wrap.oh-input-error label { color: var(--danger); }
.oh-input-error-msg {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.3rem;
  min-height: 1rem;
  padding-left: 0.25rem;
  display: block;
}

/* Show/hide pw toggle button inside input wrap */
.oh-pw-toggle {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  padding: 0;
  z-index: 2;
  line-height: 1;
}

/* ── Error Banner ────────────────────────────────────────── */
.oh-error-banner {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  display: none;
}

/* ── Success Banner ──────────────────────────────────────── */
.oh-success-banner {
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  color: var(--success);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  display: none;
}

/* ── Toast ───────────────────────────────────────────────── */
.oh-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  white-space: nowrap;
}
.oh-toast.success { background: var(--success); color: #fff; }
.oh-toast.error   { background: var(--danger);  color: #fff; }
.oh-toast.hidden  { opacity: 0; transform: translateX(-50%) translateY(1rem); pointer-events: none; }

/* ── Navbar ──────────────────────────────────────────────── */
.oh-navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Theme Toggle ────────────────────────────────────────── */
.theme-toggle-btn {
  width: 2.25rem; height: 2.25rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s;
  font-size: 1rem;
}
.theme-toggle-btn:hover { background: var(--muted); }

/* ── Auth layout ─────────────────────────────────────────── */
.oh-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.oh-auth-left {
  flex: 1;
  display: none;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0a0a12 0%, #101225 50%, #1a1230 100%);
  padding: 4rem;
  position: relative;
}
@media (min-width: 1024px) { .oh-auth-left { display: flex; } }
.oh-auth-left .glow-1 {
  position: absolute; width: 24rem; height: 24rem; border-radius: 9999px;
  background: #3b82f6; filter: blur(80px); opacity: 0.3; top: -6rem; left: -6rem;
}
.oh-auth-left .glow-2 {
  position: absolute; width: 24rem; height: 24rem; border-radius: 9999px;
  background: #9333ea; filter: blur(80px); opacity: 0.3; bottom: 0; right: 0;
}
.oh-auth-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  position: relative;
}
@media (min-width: 640px)  { .oh-auth-right { padding: 2.5rem 3rem; } }
@media (min-width: 1024px) { .oh-auth-right { padding: 2.5rem 4rem; } }
.oh-auth-form-wrap { width: 100%; max-width: 24rem; margin: 0 auto; }

/* ── Social Icon ─────────────────────────────────────────── */
.social-icon {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px; flex-shrink: 0;
}
.social-icon svg { width: 55%; height: 55%; }
.si-instagram { background: linear-gradient(135deg,#f59e0b,#ec4899,#9333ea); color:#fff; }
.si-facebook  { background: #1877F2; color:#fff; }
.si-x         { background: #000; color:#fff; }
.si-linkedin  { background: #0A66C2; color:#fff; }
.si-youtube   { background: #FF0000; color:#fff; }
.si-whatsapp  { background: #25D366; color:#fff; }
.si-tiktok    { background: #000; color:#fff; }
.si-telegram  { background: #2AABEE; color:#fff; }
.si-google    { background: #fff; color:#4285F4; border:1px solid var(--border); }
.si-snapchat  { background: #FFFC00; color:#000; }
.si-tumblr    { background: #35465C; color:#fff; }
.si-website   { background: #52525b; color:#fff; }
.si-other     { background: #71717a; color:#fff; }

/* ── Password Strength Bar ───────────────────────────────── */
.oh-pw-bar { height: 4px; border-radius: 9999px; transition: width 0.3s, background-color 0.3s; }

/* ── Spinner ─────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.oh-spinner {
  display: inline-block;
  width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

/* ── Marquee ─────────────────────────────────────────────── */
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.oh-marquee-track { display: flex; width: max-content; animation: marquee 22s linear infinite; gap: 0.75rem; }

/* ── Fade-in ─────────────────────────────────────────────── */
@keyframes fadeInUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
.oh-fade-in    { animation: fadeInUp 0.5s ease both; }
.oh-fade-in-d1 { animation-delay: 0.1s; }
.oh-fade-in-d2 { animation-delay: 0.2s; }
.oh-fade-in-d3 { animation-delay: 0.3s; }
.oh-fade-in-d4 { animation-delay: 0.4s; }

/* ── Scroll reveal ───────────────────────────────────────── */
.oh-reveal { opacity:0; transform:translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.oh-reveal.visible { opacity:1; transform:translateY(0); }

/* ── Admin Sidebar ───────────────────────────────────────── */
.oh-admin-sidebar {
  width: 16rem; border-right: 1px solid var(--border); background: var(--card);
  min-height: 100vh; padding: 1.5rem 1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  position: fixed; top: 0; left: 0; z-index: 30;
}
.oh-admin-layout { display: flex; min-height: 100vh; }
.oh-admin-content { margin-left: 16rem; flex: 1; padding: 2rem; }
@media (max-width: 768px) { .oh-admin-sidebar { display: none; } .oh-admin-content { margin-left: 0; } }
.oh-admin-nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.875rem; border-radius: 0.75rem;
  color: var(--muted-foreground); font-size: 0.875rem; font-weight: 500;
  text-decoration: none; transition: background-color 0.15s, color 0.15s; cursor: pointer;
}
.oh-admin-nav-item:hover, .oh-admin-nav-item.active { background: var(--muted); color: var(--foreground); }
.oh-admin-nav-item.active { color: var(--accent); }

/* ── Bar Chart ───────────────────────────────────────────── */
.oh-bar-chart { display: flex; align-items: flex-end; gap: 0.5rem; height: 10rem; }
.oh-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.oh-bar-inner { width: 100%; display: flex; align-items: flex-end; height: 9rem; }
.oh-bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--accent); transition: height 0.4s cubic-bezier(0.4,0,0.2,1); }

/* ── Badges ──────────────────────────────────────────────── */
.oh-badge-success { display:inline-block;padding:.125rem .625rem;border-radius:9999px;font-size:.75rem;font-weight:500;background:color-mix(in srgb,var(--success) 15%,transparent);color:var(--success); }
.oh-badge-danger  { display:inline-block;padding:.125rem .625rem;border-radius:9999px;font-size:.75rem;font-weight:500;background:color-mix(in srgb,var(--danger) 15%,transparent);color:var(--danger); }

/* ── Container ───────────────────────────────────────────── */
.container-oh { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container-oh { padding: 0 2rem; } }

/* ── OTP Inputs ──────────────────────────────────────────── */
.otp-digit {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.875rem 0.25rem !important;
  border-radius: 0.75rem !important;
  flex: 1;
  min-width: 0;
}
