/* ============================================================
   PicVault — global stylesheet (Notion-inspired light theme)
   Light theme only. Tokens from design.md.
   ============================================================ */

:root {
  /* ---- Colors ---- */
  --canvas:        #ffffff;
  --canvas-soft:   #f6f5f4;
  --hairline:      #e6e6e6;
  --field-border:  #dddddd;
  --primary:       #0075de;
  --primary-active:#005bab;
  --secondary:     #213183;
  --ink:           rgba(0, 0, 0, 0.95);
  --ink-secondary: #31302e;
  --ink-muted:     #615d59;
  --ink-faint:     #a39e98;
  --on-primary:    #ffffff;
  --danger:        #c2372d;

  /* Sticker palette — decorative only, never structural */
  --accent-sky:    #62aef0;
  --accent-purple: #d6b6f6;
  --accent-purple-deep: #391c57;
  --accent-pink:   #ff64c8;
  --accent-orange: #dd5b00;
  --accent-orange-deep: #793400;
  --accent-teal:   #2a9d99;
  --accent-green:  #1aae39;
  --accent-brown:  #523410;

  /* ---- Shape ---- */
  --r-xs: 4px;
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  /* ---- Elevation: barely-there layered shadows ---- */
  --shadow-1:
    0 0.175px 1.041px rgba(0, 0, 0, 0.01),
    0 0.8px 2.925px rgba(0, 0, 0, 0.02),
    0 2.025px 7.847px rgba(0, 0, 0, 0.027),
    0 4px 18px rgba(0, 0, 0, 0.04);
  --shadow-2:
    0 0.175px 1.041px rgba(0, 0, 0, 0.015),
    0 0.8px 2.925px rgba(0, 0, 0, 0.03),
    0 2.025px 7.847px rgba(0, 0, 0, 0.04),
    0 5px 14px rgba(0, 0, 0, 0.05),
    0 23px 52px rgba(0, 0, 0, 0.05);

  /* ---- Type ---- */
  --font: 'Inter', -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas-soft);
  font-feature-settings: 'lnum', 'locl';
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Type scale ---------- */
h1, h2, h3, h4 { font-weight: 700; color: var(--ink); }
h1 { font-size: 40px; line-height: 1.1; letter-spacing: -1px; }
h2 { font-size: 26px; line-height: 1.23; letter-spacing: -0.625px; }
h3 { font-size: 22px; line-height: 1.27; letter-spacing: -0.25px; }

.card-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.125px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.33;
  letter-spacing: 0.125px;
  text-transform: uppercase;
}

.muted  { color: var(--ink-muted); font-size: 15px; }
.caption { font-size: 14px; line-height: 1.43; color: var(--ink-muted); }
.footnote { font-size: 14px; line-height: 1.43; color: var(--ink-faint); }

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.brand-mark::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #ffffff;
  opacity: 0.95;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--r-full);
  padding: 12px 28px;
}
.btn-primary:hover { background: var(--primary-active); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--canvas);
  color: var(--ink);
  border-radius: var(--r-full);
  padding: 12px 28px;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-1);
}
.btn-secondary:hover { background: #fbfaf9; }

.btn-utility {
  background: var(--canvas);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 4px 14px;
  border: 1px solid var(--hairline);
  font-size: 15px;
}
.btn-utility:hover { background: #fbfaf9; }

.btn-block { width: 100%; }

.btn-text {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 4px 6px;
  border-radius: var(--r-sm);
}
.btn-text:hover { background: var(--canvas-soft); text-decoration: underline; }

.btn-text-danger { color: var(--danger); }
.btn-text-danger:hover { background: rgba(194, 55, 45, 0.06); }

/* ---------- Cards & containers ---------- */
.card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav bar ---------- */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-user { color: var(--ink-muted); }
.nav-user strong { color: var(--ink-secondary); font-weight: 600; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 48px 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-card h1 { font-size: 26px; letter-spacing: -0.625px; }
.auth-card p { margin-top: -12px; }

.sticker-row { display: flex; gap: 8px; }
.sticker { width: 20px; height: 20px; border-radius: 5px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; color: var(--ink-secondary); }

.text-input {
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  line-height: 1.33;
  border: 1px solid var(--field-border);
  border-radius: var(--r-xs);
  padding: 10px 12px;
  background: var(--canvas);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.text-input::placeholder { color: var(--ink-faint); }
.text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-1), 0 0 0 1px rgba(0, 117, 222, 0.25);
}

.auth-brand { align-self: center; }
.footer-note { color: var(--ink-faint); font-size: 13px; text-align: center; }

/* ---------- Alerts / toast ---------- */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-2);
  font-size: 15px;
  color: var(--ink-secondary);
  margin: 24px 0 0;
}
.toast-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.toast-success .toast-dot { background: var(--accent-green); }
.toast-error .toast-dot { background: var(--danger); }
.toast-info .toast-dot { background: var(--primary); }

/* ---------- Home: page head ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 48px 0 24px;
}
.page-head .muted { margin-top: 6px; }

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--canvas);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.125px;
  border-radius: var(--r-full);
  padding: 4px 12px;
  border: 1px solid var(--hairline);
  white-space: nowrap;
}

/* ---------- Upload card ---------- */
.upload-card { padding: 16px; }
.upload-well {
  border: 1.5px dashed #d8d4cf;
  border-radius: var(--r-lg);
  padding: 36px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: #fbfaf9;
}
.upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--secondary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.upload-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.upload-hint { font-size: 14px; color: var(--ink-faint); }
.upload-well .btn { margin-top: 10px; }

.file-input {
  font-size: 14px;
  color: var(--ink-muted);
  max-width: 100%;
}
.file-input::file-selector-button {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 8px 14px;
  margin-right: 12px;
  cursor: pointer;
}
.file-input::file-selector-button:hover { background: #fbfaf9; }

/* ---------- Image grid ---------- */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin: 24px 0 64px;
}
.image-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.thumb {
  background: var(--canvas-soft);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.image-card figcaption {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.125px;
  overflow-wrap: anywhere;
}
.meta { font-size: 13px; color: var(--ink-faint); }

/* ---------- Rename ---------- */
.rename { margin-top: 6px; }
.rename summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 2px 0;
  width: fit-content;
}
.rename summary::-webkit-details-marker { display: none; }
.rename summary:hover { color: var(--primary); }
.rename-form { display: flex; gap: 8px; margin-top: 8px; }
.rename-form .text-input { padding: 8px 10px; flex: 1; font-size: 14px; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  margin-bottom: 64px;
}
.empty-tile {
  width: 64px;
  height: 64px;
  border-radius: var(--r-xl);
  margin: 0 auto 18px;
  background: var(--accent-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.empty-tile::after {
  content: '';
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--accent-orange);
  opacity: 0.9;
}
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { max-width: 340px; margin: 0 auto 22px; }

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  background: var(--canvas-soft);
  border-top: 1px solid var(--hairline);
  padding: 28px 24px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}

/* ---------- Error page ---------- */
.error-card {
  max-width: 480px;
  margin: 80px auto;
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .auth-card { padding: 24px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .nav-user { display: none; }
  .upload-well { padding: 28px 16px; }
  .btn-primary, .btn-secondary { padding: 12px 22px; }
}
