:root {
  --bg: #141414;
  --card: #1e1e1e;
  --text: #ffffff;
  --muted: #888888;
  --accent: #FF5B21;
  --accent-hover: #e04d18;
  --border: #2a2a2a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "CoFo Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.logo-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem 0.5rem;
}

.logo-header img {
  height: 44px;
  width: auto;
}

.logo-collab {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.05em;
}

.container {
  width: min(760px, 92vw);
  margin: 1.25rem auto 3rem;
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ── Tabs ── */

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: #111111;
  border-radius: 12px;
  padding: 4px;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.01em;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 91, 33, 0.3);
}

/* ── Tab content ── */

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Form ── */

.form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

input {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  background: #111111;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}

input:focus {
  border-color: var(--accent);
}

input::placeholder {
  color: #555;
}

button,
.actions a,
.sem-actions a {
  border-radius: 10px;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent);
  color: white;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  letter-spacing: 0.01em;
  display: inline-block;
  text-align: center;
}

button:hover,
.actions a:hover,
.sem-actions a:hover {
  background: var(--accent-hover);
}

button:active,
.actions a:active,
.sem-actions a:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  min-height: 1.25rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Banner result ── */

.result {
  margin-top: 1.2rem;
}

.result img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #111;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

/* ── Semantics result card ── */

.semantics-result {
  margin-top: 1.2rem;
}

.sem-card {
  background: #111111;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.sem-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
}

.sem-row + .sem-row {
  border-top: 1px solid var(--border);
}

.sem-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.sem-value {
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}

.sem-highlight {
  color: var(--accent);
  font-size: 1.25rem;
}

.sem-actions {
  margin-top: 1rem;
  display: flex;
}

.sem-actions a {
  width: 100%;
}

/* ── Utilities ── */

.hidden {
  display: none;
}

.modal {
  border: none;
  border-radius: 16px;
  padding: 1rem;
  max-width: 92vw;
  background: #ffffff;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.modal img {
  max-width: 88vw;
  max-height: 75vh;
  display: block;
  margin-bottom: 0.75rem;
  border-radius: 8px;
}

@media (max-width: 640px) {
  .row {
    grid-template-columns: 1fr;
  }
}

/* ── Auth overlay ── */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-overlay.hidden {
  display: none;
}

.auth-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Error page ── */

.error-container {
  text-align: center;
  padding: 3rem 2rem;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1rem;
}

.error-text {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 2rem;
}

.login-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s ease;
}

.login-btn:hover {
  background: var(--accent-hover);
}
