/* ============================================================
   INONEOS — Neumorphic Design System
   Palette: soft indigo-grey base, violet-blue accent
   Signature: pressed/raised soft-UI surfaces throughout
   ============================================================ */

:root {
  --bg: #e6ebf3;
  --bg-raised: #eef2f9;
  --shadow-dark: #b9c2d1;
  --shadow-light: #ffffff;

  --text: #2e3447;
  --text-muted: #6b7382;
  --text-faint: #9aa2b2;

  --accent: #5b6ef5;
  --accent-2: #8b5cf6;
  --accent-soft: #dfe4ff;

  --success: #2fa878;
  --danger: #e0526b;
  --warning: #e0a527;

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

  --font-display: "Poppins", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--text);
}

p { margin: 0; }

button {
  font-family: var(--font-body);
}

::selection {
  background: var(--accent-soft);
}

/* Scrollbar - soft */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--shadow-dark);
  border-radius: 10px;
}

/* ---------- Core raised surface ---------- */
.neu-raised {
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
}

.neu-flat {
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
}

.neu-pressed {
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
}

/* ---------- Card ---------- */
.neu-card {
  background: var(--bg-raised);
  border-radius: var(--radius-lg);
  box-shadow: 9px 9px 18px var(--shadow-dark), -9px -9px 18px var(--shadow-light);
  padding: 28px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.neu-card--interactive {
  cursor: pointer;
}

.neu-card--interactive:hover {
  transform: translateY(-3px);
  box-shadow: 12px 12px 22px var(--shadow-dark), -12px -12px 22px var(--shadow-light);
}

.neu-card--interactive:active {
  transform: translateY(0);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
}

.neu-card--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.neu-card--disabled:hover {
  transform: none;
  box-shadow: 9px 9px 18px var(--shadow-dark), -9px -9px 18px var(--shadow-light);
}

/* ---------- Buttons ---------- */
.neu-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  color: var(--text);
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.neu-btn:hover { transform: translateY(-1px); }

.neu-btn:active {
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  transform: translateY(0);
}

.neu-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.neu-btn--primary {
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 6px 6px 14px rgba(91, 110, 245, 0.35), -4px -4px 10px rgba(255, 255, 255, 0.5);
}

.neu-btn--primary:active {
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.25), inset -2px -2px 6px rgba(255, 255, 255, 0.2);
}

.neu-btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.neu-btn--full { width: 100%; }
.neu-btn--danger { color: var(--danger); }

/* ---------- Inputs ---------- */
.neu-input,
.neu-textarea,
.neu-select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: none;
  outline: none;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.neu-textarea { resize: vertical; min-height: 120px; font-family: var(--font-body); }

.neu-input::placeholder,
.neu-textarea::placeholder { color: var(--text-faint); }

.neu-input:focus,
.neu-textarea:focus,
.neu-select:focus {
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light),
    0 0 0 2px var(--accent-soft);
}

.neu-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}

/* ---------- Signature: OTP pressed cells ---------- */
.otp-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 8px 0 4px;
}

.otp-cell {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--bg);
  border: none;
  border-radius: 16px;
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  outline: none;
  transition: box-shadow 0.15s ease;
}

.otp-cell:focus {
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light),
    0 0 0 2px var(--accent);
}

/* ---------- Toggle switch (signature reused element) ---------- */
.neu-toggle {
  width: 52px;
  height: 30px;
  border-radius: 20px;
  background: var(--bg);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  position: relative;
  cursor: pointer;
  border: none;
  padding: 0;
}

.neu-toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-raised);
  box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
  transition: left 0.2s ease, background 0.2s ease;
}

.neu-toggle--on .neu-toggle__knob {
  left: 25px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
}

/* ---------- Layout ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-raised);
  box-shadow: 6px 0 16px var(--shadow-dark);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 24px;
}

.sidebar-brand__mark {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  /* box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light); */
  position: relative;
  overflow: hidden;
}
.sidebar-brand__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sidebar-brand__logo.loaded {
  opacity: 1;
}
.sidebar-brand__logo.loaded + .sidebar-brand__fallback {
  display: none;
}
.sidebar-brand__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 700;
  padding: 16px 12px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  background: var(--bg);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  color: var(--text);
}

.sidebar-link--active {
  background: var(--bg);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  color: var(--accent);
  font-weight: 600;
}

.main-area {
  flex: 1;
  padding: 32px 40px 60px;
  max-width: 1280px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 20px;
}

.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.category-block {
  margin-bottom: 40px;
}

.category-block__title {
  font-size: 20px;
  margin-bottom: 4px;
}

.category-block__sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 18px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
}

.tool-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.tool-card__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.tool-card__desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  width: fit-content;
}

.badge--live { background: rgba(47, 168, 120, 0.15); color: var(--success); }
.badge--soon { background: rgba(154, 162, 178, 0.2); color: var(--text-faint); }
.badge--ai { background: rgba(139, 92, 246, 0.15); color: var(--accent-2); }

/* ---------- Auth page ---------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 42px 36px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-tab--active {
  background: var(--bg-raised);
  color: var(--accent);
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.field-group { margin-bottom: 18px; }

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.alert--error { background: rgba(224, 82, 107, 0.12); color: var(--danger); }
.alert--success { background: rgba(47, 168, 120, 0.12); color: var(--success); }
.alert--info { background: var(--accent-soft); color: var(--accent); }

.credential-box {
  text-align: center;
  padding: 18px;
  margin: 10px 0 20px;
}

.credential-box__value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
  margin: 6px 0;
  word-break: break-all;
}

/* ---------- Utility ---------- */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.w-full { width: 100%; }
.center { display: flex; align-items: center; justify-content: center; }
.space-between { display: flex; align-items: center; justify-content: space-between; }

.result-panel {
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  padding: 22px;
  margin-top: 20px;
}

.result-number {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.row-fields {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.prose {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.prose h1, .prose h2, .prose h3 { margin-top: 18px; margin-bottom: 8px; }

.mobile-menu-btn, .mobile-close-btn, .sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .app-shell { display: block; }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 40;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--bg);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    font-size: 20px;
    color: var(--text);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(280px, 82vw);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  .sidebar--open { transform: translateX(0); }

  .mobile-close-btn {
    display: block;
    align-self: flex-end;
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 8px;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-backdrop--visible { opacity: 1; pointer-events: auto; }

  .main-area {
    padding: 20px 16px;
    padding-top: 70px;
    width: 100%;
  }

  .row-fields { grid-template-columns: 1fr; }
  .row-fields > div { width: 100%; }
  .grid { grid-template-columns: 1fr !important; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .neu-card { max-width: 100% !important; }
  .auth-card { width: 92vw; max-width: 420px; }
  table { font-size: 12px; }
  .space-between { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 480px) {
  h1 { font-size: 22px; }
  h2 { font-size: 19px; }
  .result-number { font-size: 32px; }
  .tool-card__icon { width: 40px; height: 40px; font-size: 20px; }
}
