/* PhotoSpeak web client - Phase 0 styling. Dark + gold, matches the app brand. */
:root {
  --bg: #14110d;
  --panel: #1d1916;
  --panel-2: #262019;
  --text: #ece6dc;
  --muted: #9a9085;
  --accent: #d4a24e;
  --accent-dim: #a37a32;
  --error: #e07a5f;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
.hidden { display: none !important; }

.brand { font-weight: 700; letter-spacing: .5px; }
.brand span { color: var(--accent); }
.brand.big { font-size: 2rem; }

/* Buttons */
.btn {
  border: 1px solid transparent; border-radius: var(--radius);
  padding: .55rem 1rem; font-size: .95rem; cursor: pointer;
  background: var(--panel-2); color: var(--text);
}
.btn:hover { border-color: var(--accent-dim); }
.btn.primary { background: var(--accent); color: #1a1409; font-weight: 600; }
.btn.primary:hover { background: var(--accent-dim); }
.btn.ghost { background: transparent; border-color: #3a3128; }
.btn.wide { width: 100%; margin-top: .5rem; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; }

/* Top bar */
#topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1.25rem; background: var(--panel);
  border-bottom: 1px solid #2c2419; position: sticky; top: 0; z-index: 5;
}
#topbar .spacer { flex: 1; }
.who { color: var(--muted); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card {
  background: var(--panel); border: 1px solid #2c2419; border-radius: 16px;
  padding: 2.25rem; width: 100%; max-width: 360px; text-align: center;
}
.tagline { color: var(--muted); margin: .35rem 0 1.5rem; }
#loginForm { display: flex; flex-direction: column; gap: .65rem; }
#loginForm input {
  padding: .7rem .85rem; border-radius: var(--radius);
  border: 1px solid #3a3128; background: var(--panel-2); color: var(--text);
}
#loginForm input:focus { outline: none; border-color: var(--accent); }
.error { color: var(--error); margin: .75rem 0 0; }
.fineprint { color: var(--muted); font-size: .8rem; margin-top: 1.25rem; }

/* Demo banner */
.demo-banner {
  background: var(--panel-2); color: var(--muted);
  padding: .6rem 1.25rem; border-bottom: 1px solid #2c2419; font-size: .9rem;
}

/* Gallery */
.status { color: var(--muted); padding: .9rem 1.25rem .25rem; font-size: .85rem; }
.grid {
  display: grid; gap: 6px; padding: 1rem 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.tile {
  position: relative; aspect-ratio: 1; background: var(--panel-2);
  border-radius: 8px; overflow: hidden; cursor: pointer;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:hover { outline: 2px solid var(--accent); }
.vt-badge {
  position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.6);
  color: var(--accent); font-size: .75rem; padding: 2px 6px; border-radius: 6px;
}
.more { text-align: center; padding: 1rem 0 2rem; }

/* Detail overlay */
.detail-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.8);
  display: grid; place-items: center; padding: 1.5rem; z-index: 20;
}
.detail-panel {
  background: var(--panel); border-radius: 14px; overflow: hidden;
  display: grid; grid-template-columns: 1fr 340px;
  max-width: 1100px; width: 100%; max-height: 90vh; position: relative;
}
.detail-close {
  position: absolute; top: 10px; right: 14px; z-index: 2;
  background: rgba(0,0,0,.5); color: #fff; border: none; border-radius: 50%;
  width: 34px; height: 34px; font-size: 1.4rem; cursor: pointer;
}
.detail-image { background: #000; display: grid; place-items: center; }
.detail-image img { max-width: 100%; max-height: 90vh; object-fit: contain; }
.detail-meta { padding: 1.5rem; overflow-y: auto; }
.readonly-tag {
  display: inline-block; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .5px; color: var(--accent); border: 1px solid var(--accent-dim);
  border-radius: 6px; padding: 2px 8px; margin-bottom: .75rem;
}
.detail-meta h2 { margin: 0 0 1rem; }
.field { display: grid; grid-template-columns: 110px 1fr; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid #2c2419; }
.flabel { color: var(--muted); font-size: .85rem; }
.fval { white-space: pre-wrap; }
.vt-head { margin: 1.25rem 0 .5rem; font-size: .95rem; }
.thread { background: var(--panel-2); border-radius: 8px; padding: .6rem .8rem; margin-bottom: .5rem; }
.tauthor { color: var(--accent); font-size: .85rem; margin-bottom: .2rem; }
.ttext { white-space: pre-wrap; }

@media (max-width: 720px) {
  .detail-panel { grid-template-columns: 1fr; max-height: 95vh; }
  .detail-image img { max-height: 45vh; }
}
