/* ---------- Base ---------- */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Inter,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 15px;
  color: #111827;
  background: #ffffff;
}

a {
  color: #f97316; /* orange */
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ---------- Navbar ---------- */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.2px;
}

.nav-links {
  display: flex;
  gap: 14px;
}

.nav-links a {
  color: #111827;
  font-size: 14px;
  opacity: 0.85;
}
.nav-links a:hover {
  opacity: 1;
  text-decoration: none;
}

.nav-links a.active {
  color: #f97316;
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: #6b7280;
}

.btn {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
}

.btn:hover {
  background: #fafafa;
}

/* ---------- Page ---------- */

.container {
  max-width: 1000px;
  margin: auto;
}

/* ---------- Fixed Sidebar (replaces topbar) ---------- */

:root{
    --accent:#f97316;
    --border:#e5e7eb;
    --text:#111827;
    --muted:#6b7280;
    --bg:#ffffff;
  
    /* ~15% screen width with sane limits */
    --sidebar-w: clamp(200px, 15vw, 280px);
  }
  
  body{ background: var(--bg); }
  
  /* Shell layout */
  .shell{
    min-height:100vh;
  }
  
  /* Sidebar */
  .sidebar{
    position:fixed;
    top:0;
    left:0;
    height:100vh;
    width:var(--sidebar-w);
    background:#fff;
    border-right:1px solid var(--border);
    padding:14px 14px;
    display:flex;
    flex-direction:column;
    gap:14px;
  }
  
  .brand{
    font-weight:800;
    letter-spacing:-0.2px;
    font-size:16px;
  }
  
  .side-meta{
    font-size:12px;
    color:var(--muted);
    line-height:1.35;
  }
  
  .side-nav{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:6px;
  }
  
  .side-nav a{
    display:flex;
    align-items:center;
    gap:10px;
    padding:9px 10px;
    border-radius:10px;
    color:var(--text);
    border:1px solid transparent;
    opacity:0.9;
    text-decoration:none;
  }
  
  .side-nav a:hover{
    background:#fafafa;
  }
  
  .side-nav a.active{
    border-color:var(--accent);
    background:#fff7ed;
    color:var(--accent);
    opacity:1;
    font-weight:600;
  }
  
  .sidebar-footer{
    margin-top:auto;
    border-top:1px solid var(--border);
    padding-top:12px;
    display:flex;
    flex-direction:column;
    gap:10px;
  }
  
  .btn{
    padding:8px 10px;
    font-size:13px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#fff;
    cursor:pointer;
  }
  .btn:hover{ background:#fafafa; }
  
  /* Main content */
  .main{
    margin-left:var(--sidebar-w);
    width:calc(100% - var(--sidebar-w));
  }
  
  .container{
    max-width:1100px;
    margin:0 auto;
    padding:18px 16px;
  }
  
  /* ---------- Mobile: sidebar becomes topbar ---------- */
@media (max-width: 820px) {
  /* sidebar turns into a topbar */
  .sidebar{
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 50;

    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  /* make nav horizontal */
  .side-nav{
    flex-direction: row;
    gap: 8px;
    margin-top: 0;
  }

  /* compact buttons/links for small screens */
  .side-nav a{
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* footer sits inline (logout button) */
  .sidebar-footer{
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    flex-direction: row;
    align-items: center;
  }

  /* IMPORTANT: remove left offset in mobile */
  .main{
    margin-left: 0;
    width: 100%;
  }

  .container{
    padding: 14px 14px;
  }

  /* optional: hide extra meta text to keep the topbar clean */
  .side-meta{
    display: none;
  }
}

/* ------------------------------
   Auth page — "minimal wow"
   ------------------------------ */

   .auth {
    min-height: calc(100vh - 24px);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 18px;
    align-items: center;
    padding: 22px 16px;
    max-width: 980px;
    margin: 0 auto;
  }
  
  /* subtle, unexpected background without looking busy */
  .auth::before{
    content:"";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
      radial-gradient(600px 260px at 20% 10%, rgba(249,115,22,.16), transparent 55%),
      radial-gradient(520px 280px at 85% 35%, rgba(249,115,22,.12), transparent 60%),
      linear-gradient(to bottom, rgba(17,24,39,.02), transparent 40%);
  }
  
  .auth-card{
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(17,24,39,.06);
  }
  
  .auth-badge{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .2px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(249,115,22,.25);
    padding: 6px 10px;
    border-radius: 999px;
  }
  
  .auth-title{
    margin-top: 12px;
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -0.6px;
  }
  
  .auth-sub{
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
    max-width: 54ch;
  }
  
  .auth-form{ margin-top: 14px; }
  
  .auth-label{
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
  }
  
  .auth-field{
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
  }
  
  .auth-prefix{
    padding: 10px 12px;
    font-size: 13px;
    color: var(--muted);
    background: #fafafa;
    border-right: 1px solid var(--border);
    white-space: nowrap;
  }
  
  .auth-input{
    width: 100%;
    border: 0;
    outline: none;
    padding: 10px 12px;
    font-size: 14px;
    background: transparent;
  }
  
  .auth-input::placeholder{ color: #9ca3af; }
  
  .auth-field:focus-within{
    border-color: rgba(249,115,22,.55);
    box-shadow: 0 0 0 4px rgba(249,115,22,.12);
  }
  
  .auth-cta{
    margin-top: 12px;
    width: 100%;
    justify-content: center;
    font-weight: 600;
  }
  
  .auth-hint{
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
  }
  
  .auth-hint code{
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fafafa;
  }
  
  .auth-side{
    position: relative;
  }
  
  .auth-side-card{
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
  }
  
  .auth-side-title{
    margin: 0 0 10px 0;
    font-size: 14px;
    letter-spacing: -0.2px;
  }
  
  .auth-side-list{
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
    color: var(--text);
    font-size: 13px;
  }
  
  .auth-side-list li{
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.4;
  }
  
  .auth-side-list .dot{
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-top: 5px;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(249,115,22,.12);
  }
  
  .auth-side-foot{
    margin-top: 14px;
    display: flex;
    justify-content: flex-start;
  }
  
  /* Mobile: collapse to single column */
  @media (max-width: 860px){
    .auth{
      grid-template-columns: 1fr;
      padding: 18px 14px;
    }
    .auth-side{ display: none; } /* keeps it super clean on mobile */
    .auth-title{ font-size: 26px; }
  }
  
/* ------------------------------
   Button loading micro-interaction
   ------------------------------ */

   .auth-cta{
    position: relative;
    overflow: hidden;
  }
  
  .auth-cta .btn-text,
  .auth-cta .btn-arrow{
    transition: opacity .2s ease, transform .2s ease;
  }
  
  .auth-cta .btn-spinner{
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(249,115,22,.35);
    border-top-color: var(--accent);
    opacity: 0;
    animation: spin .9s linear infinite;
  }
  
  /* Spinner animation */
  @keyframes spin{
    to { transform: rotate(360deg); }
  }
  
  /* When form is submitting */
  .auth-form:has(button:active),
  .auth-form:has(button:focus-visible){
    pointer-events: none;
  }
  
  .auth-form:has(button:active) .auth-cta,
  .auth-form:has(button:focus-visible) .auth-cta{
    background: var(--accent-soft);
    border-color: var(--accent);
  }
  
  /* Visual loading state */
  .auth-form:has(button:active) .btn-text,
  .auth-form:has(button:active) .btn-arrow,
  .auth-form:has(button:focus-visible) .btn-text,
  .auth-form:has(button:focus-visible) .btn-arrow{
    opacity: 0;
    transform: translateY(-4px);
  }
  
  .auth-form:has(button:active) .btn-spinner,
  .auth-form:has(button:focus-visible) .btn-spinner{
    opacity: 1;
  }

  
  /* =========================
   Minimal App Footer
   ========================= */

.app-footer{
  margin-top: 48px;
  padding: 18px 14px 22px;
  border-top: 1px solid var(--border);
  background: transparent;
}

.app-footer__inner{
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.app-footer .brand{
  font-weight: 600;
  letter-spacing: .2px;
}

.app-footer .muted{
  color: var(--muted);
}

.app-footer .dot{
  margin: 0 6px;
  opacity: .4;
}

/* Mobile */
@media (max-width: 720px){
  .app-footer__inner{
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

/* --- Fix mobile "button not clickable" (overlay / stacking) --- */
.auth {
  position: relative;
}

.auth-card {
  position: relative;
  z-index: 5;              /* keep it above side/gradients */
}

/* if you have any fancy background layer/pseudo element, it must not capture taps */
.auth::before,
.auth::after,
.auth-side::before,
.auth-side::after,
.auth-side-card::before,
.auth-side-card::after {
  pointer-events: none;
}

/* Mobile: stack vertically and avoid side panel overlaying the card */
@media (max-width: 820px) {
  .auth {
    display: block;        /* instead of flex */
  }

  .auth-side {
    display: none;         /* simplest: hide side panel on mobile */
  }

  /* if you want to keep it, use this instead of display:none:
  .auth-side { margin-top: 14px; }
  */
}

.auth-cta,
.auth-cta * {
  pointer-events: none;     /* children should not capture taps */
}

.auth-cta {
  pointer-events: auto;     /* but the button itself must */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.doc h2{
  margin: 34px 0 12px;
}

.doc h3{
  margin: 26px 0 10px;
}

.doc p{
  margin: 12px 0;
}

.doc h2 + p,
.doc h3 + p{
  margin-top: 6px;
}
