/* ═══════════════════════════════════════════════════════════════════════════
   Call-Transcription — standalone UI. RTL, responsive, professional.
   Deliberately NOT Signely's design system.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #eef2f4;
  --surface: #ffffff;
  --ink: #16232b;
  --ink-soft: #5b6b74;
  --line: #d9e0e4;
  --primary: #0d7a6f;
  --primary-dark: #0a5f56;
  --primary-tint: #e6f3f1;
  --danger: #b42318;
  --danger-tint: #fdecea;
  --ok: #0d7a6f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(16, 35, 43, 0.08);
  --font: "Segoe UI", "Assistant", "Rubik", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win over class-based display rules
   (e.g. .boot{display:grid}, .file-card{display:flex}). Without this, a hidden
   overlay can still render and intercept clicks. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Boot / spinner ── */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 50;
}
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  width: 100%;
}
.login-card { max-width: 400px; margin: auto; }
.app-card { max-width: 760px; }
.card-title {
  font-size: 1.4rem;
  margin: 0 0 20px;
  font-weight: 700;
}

/* ── Brand ── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.brand-mark { flex: none; border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 1.05rem; }
.brand-text span { font-size: 0.82rem; color: var(--ink-soft); }
.brand-sm strong { font-size: 0.98rem; }

/* ── Login layout ── */
#login-view { justify-content: center; padding: 24px; }

/* ── App header ── */
.app-header {
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 4px;
  gap: 12px;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--ink-soft); font-size: 0.9rem; }
#app-view { padding: 8px 20px 40px; }

/* ── Fields ── */
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  direction: rtl;
}
input:focus, textarea:focus, .dropzone:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* ── Buttons ── */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; display: block; }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--primary-dark); }
.btn-secondary { background: var(--primary-tint); color: var(--primary-dark); border-color: transparent; }
.btn-secondary:hover { background: #d6ece9; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: #f3f6f7; }

/* ── Messages ── */
.error-msg {
  background: var(--danger-tint);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 0.9rem;
  margin: 0 0 16px;
}
.toast {
  margin: 12px 0 0;
  color: var(--ok);
  font-size: 0.9rem;
  text-align: center;
}

/* ── Dropzone ── */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  color: var(--ink-soft);
  background: #fbfdfd;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.dragover { border-color: var(--primary); background: var(--primary-tint); }
.dz-icon { color: var(--primary); margin-bottom: 6px; }
.dz-title { font-weight: 700; color: var(--ink); margin: 4px 0; }
.dz-sub { margin: 6px 0; font-size: 0.85rem; }
.dz-hint { font-size: 0.8rem; margin: 12px 0 0; }

/* ── File card ── */
.file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
  background: #fbfdfd;
}
.file-meta { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-icon { color: var(--primary); flex: none; }
.file-info { display: flex; flex-direction: column; min-width: 0; }
.file-name { font-weight: 600; word-break: break-all; }
.file-sub { font-size: 0.83rem; color: var(--ink-soft); }
.file-sub span + span::before { content: " · "; }
#start-btn { margin-top: 18px; }

/* ── Progress ── */
.progress-box { text-align: center; padding: 26px 10px 10px; }
.progress-box .spinner { margin: 0 auto 14px; }
.progress-title { font-weight: 700; margin: 0 0 4px; }
.progress-sub { color: var(--ink-soft); font-size: 0.85rem; margin: 0; }
.steps {
  list-style: none;
  padding: 0;
  margin: 22px auto 0;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.steps li {
  position: relative;
  padding-inline-start: 28px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.steps li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
}
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--primary); border-color: var(--primary); }
.steps li.active { color: var(--primary-dark); font-weight: 600; }
.steps li.active::before { border-color: var(--primary); }

/* ── Result ── */
.result-status {
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}
.result-ok { background: var(--primary-tint); color: var(--primary-dark); }
.result-failed { background: var(--danger-tint); color: var(--danger); }
.fail-msg { margin: 0; }
.result-meta { color: var(--ink-soft); font-size: 0.85rem; margin: 0 0 12px; }
.result-secondary { margin-top: 12px; text-align: center; }
.progress-pct { font-variant-numeric: tabular-nums; }
.transcript {
  min-height: 320px;
  resize: vertical;
  line-height: 1.7;
  font-size: 0.98rem;
  white-space: pre-wrap;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.result-actions .btn { flex: 1 1 160px; }

/* ── Footer ── */
.page-footer {
  margin-top: auto;
  padding: 22px 0 8px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

/* ── Mobile ── */
@media (max-width: 560px) {
  .card { padding: 20px; border-radius: 12px; }
  .app-header { padding: 14px 2px; }
  .result-actions .btn { flex: 1 1 100%; }
  body { font-size: 15px; }
}
