:root {
  --bg: #121110;
  --panel: #201f1e;
  --panel-2: #181716;
  --panel-3: #272624;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f5f5f4;
  --muted: #a8a29e;
  --accent: #f25a15;
  --accent-hover: #ff6e26;
  --accent-active: #df4e0a;
  --accent-glow: rgba(242, 90, 21, 0.32);
  --accent-text: #ffffff;
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.12);
  --error: #fb7185;
  --error-bg: rgba(251, 113, 133, 0.12);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(242, 90, 21, 0.09), transparent 55%),
    radial-gradient(circle at 90% 20%, rgba(242, 90, 21, 0.04), transparent 40%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.centered-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 0;
}

.dashboard-shell { padding: 34px 0 60px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.loading-card {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #ffffff;
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin: 0 auto 20px;
  box-shadow: 0 8px 20px rgba(242, 90, 21, 0.35);
}

.brand-mark.compact {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin: 0;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(242, 90, 21, 0.25);
}

.eyebrow {
  margin: 0 0 8px;
  color: #d6d3d1;
  font-size: 11px;
  letter-spacing: .16em;
  font-weight: 800;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 8px;
  font-size: clamp(23px, 3vw, 30px);
  letter-spacing: -0.04em;
  color: #ffffff;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.small-copy { font-size: 13px; }
.center-copy { text-align: center; margin: 14px 0 0; line-height: 1.5; }

/* Login Container & Reference Style */
.login-container {
  width: min(390px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.top-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.accent-bar {
  display: block;
  width: 38px;
  height: 3.5px;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(242, 90, 21, 0.4);
}

.lang-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.lang-tag {
  color: #78716c;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 999px;
  transition: color .15s ease;
}

.lang-tag.active {
  background: var(--accent);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(242, 90, 21, 0.3);
}

.login-card {
  width: min(500px, 100%);
  max-width: 500px;
  padding: 32px 28px 30px;
  text-align: center;
  background: #201f1e;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.login-card h1 {
  margin-bottom: 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-subtitle {
  color: #9c958f;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 22px;
}

.login-copy { line-height: 1.6; margin-bottom: 28px; }
.login-form { display: grid; gap: 16px; text-align: left; }
.login-form label { display: grid; gap: 6px; }
.login-form label > span { color: #d6d3d1; font-size: 12px; font-weight: 600; }

input[type="email"], input[type="password"] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: #161514;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input[type="email"]::placeholder, input[type="password"]::placeholder {
  color: #78716c;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.primary-button, .ghost-button, .text-button, .drop-zone {
  border: 0;
  cursor: pointer;
}

.primary-button {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 13px;
  transition: transform .16s ease, background-color .16s ease, opacity .16s ease, box-shadow .16s ease;
  box-shadow: 0 4px 16px rgba(242, 90, 21, 0.35);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-hover);
  box-shadow: 0 6px 22px rgba(242, 90, 21, 0.45);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
  background: var(--accent-active);
}

.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.full-width { width: 100%; }

.ghost-button {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: #e7e5e4;
  font-weight: 600;
  font-size: 13px;
  transition: background-color .16s, border-color .16s, color .16s;
}
.ghost-button:hover {
  background: rgba(242, 90, 21, 0.08);
  border-color: rgba(242, 90, 21, 0.4);
  color: #ffffff;
}

.text-button {
  padding: 0;
  background: transparent;
  color: #ff853f;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:hover { color: var(--accent-hover); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 2px 28px;
}

.topbar-brand { display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin: 0; font-size: 24px; }
.topbar .eyebrow { margin-bottom: 4px; }
.user-actions { display: flex; align-items: center; gap: 14px; }
.user-copy { display: grid; gap: 3px; text-align: right; }
.user-copy span { font-size: 13px; font-weight: 700; color: #fafaf9; }
.user-copy small { color: var(--muted); font-size: 11px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: 22px;
}

.current-panel, .upload-panel { padding: 26px; }
.section-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 20px; }

.status-pill {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}
.status-pill.live {
  background: rgba(242, 90, 21, 0.12);
  color: #ff853f;
  border: 1px solid rgba(242, 90, 21, 0.3);
}

.preview-frame {
  overflow: hidden;
  background: #141312;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.current-frame { aspect-ratio: 16 / 10; }
.media-preview { width: 100%; height: 100%; object-fit: contain; display: block; background: #0e0d0c; }

.empty-preview {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.empty-preview-icon { font-size: 38px; color: #78716c; }
.error-text { color: var(--error); padding: 24px; text-align: center; }

.metadata-grid {
  display: grid;
  grid-template-columns: 1.3fr .7fr 1fr .8fr;
  gap: 10px;
  padding-top: 16px;
}
.metadata-grid > div {
  min-width: 0;
  padding: 12px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-radius: 11px;
}
.metadata-grid span, .metadata-grid strong { display: block; }
.metadata-grid span { margin-bottom: 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.metadata-grid strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f5f5f4; }

.drop-zone {
  width: 100%;
  min-height: 210px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.015);
  transition: background .2s, border-color .2s, transform .2s;
}
.drop-zone:hover:not(:disabled), .drop-zone.dragging {
  background: rgba(242, 90, 21, 0.05);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.drop-zone:disabled { cursor: not-allowed; opacity: .55; }
.drop-zone strong { font-size: 16px; color: #fafaf9; }
.drop-zone span { color: var(--muted); font-size: 13px; }
.drop-zone small { margin-top: 8px; color: #a8a29e; letter-spacing: .08em; font-size: 10px; font-weight: 800; }
.upload-symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(242, 90, 21, 0.3);
}

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

.selected-card {
  margin-top: 15px;
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 15px;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.selected-preview { aspect-ratio: 16/10; overflow: hidden; border-radius: 10px; background: #121110; }
.selected-details { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; }
.selected-name { max-width: 100%; margin: 0 0 4px; font-weight: 750; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-details p { margin-bottom: 0; }

.switch-row { display: flex; gap: 18px; }
.toggle-line { display: flex; align-items: center; gap: 8px; color: #e7e5e4; font-size: 12px; font-weight: 700; cursor: pointer; }
.toggle-line input { accent-color: var(--accent); }

.progress-wrap { margin-top: 16px; }
.progress-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.progress-head strong { color: var(--text); }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.07); }
.progress-bar { height: 100%; border-radius: inherit; background: var(--accent); transition: width .16s ease; }

.message { margin-top: 14px; padding: 12px 13px; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.success-message { color: var(--success); background: var(--success-bg); border: 1px solid rgba(74, 222, 128, .2); }
.error-message { color: var(--error); background: var(--error-bg); border: 1px solid rgba(251, 113, 133, .2); }

.publish-button { width: 100%; margin-top: 18px; min-height: 52px; text-transform: uppercase; letter-spacing: .05em; font-size: 13px; }
code { padding: 2px 5px; border-radius: 5px; background: rgba(255,255,255,.06); color: #ffad7a; }

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .metadata-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 650px) {
  .page-shell { width: min(100% - 24px, 1180px); }
  .dashboard-shell { padding-top: 18px; }
  .topbar { align-items: flex-start; }
  .topbar-brand .eyebrow { display: none; }
  .topbar h1 { font-size: 18px; }
  .user-copy { display: none; }
  .current-panel, .upload-panel, .login-card { padding: 20px; }
  .metadata-grid { grid-template-columns: 1fr 1fr; }
  .selected-card { grid-template-columns: 1fr; }
  .selected-preview { aspect-ratio: 16/9; }
}
.hidden { display: none !important; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .94em; }

/* AR SETTINGS */
.ar-settings-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.018);
}

.settings-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.settings-heading h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -.015em;
  color: #fafaf9;
}

.settings-heading .eyebrow { margin-bottom: 4px; }

.settings-note {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.number-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.number-field > span {
  color: #e7e5e4;
  font-size: 11px;
  font-weight: 800;
}

.number-field > small {
  color: var(--muted);
  font-size: 10px;
}

input[type="number"] {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #161514;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.settings-actions p { margin: 0; line-height: 1.45; }
.settings-save-button { flex: 0 0 auto; }

@media (max-width: 650px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .settings-save-button { width: 100%; }
}
