:root {
  --brand: #C06F33;      /* amber — primary actions */
  --brand-dark: #a75c26;
  --dark: #30211F;       /* logo background / app-bar / headings */
  --rose: #DB978B;       /* secondary accent */
  --cream: #F1E5D8;      /* tinted surfaces */
  --bg: #FFFBF7;         /* page background */
  --card: #ffffff;
  --text: #2a1e1c;
  --muted: #8a7770;
  --border: #ece1d8;
  --danger: #c9483f;
  --success: #1a9c5c;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--dark);
  border-bottom: 1px solid var(--dark);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-bar h1 {
  font-size: 16px;
  margin: 0;
  color: var(--cream);
  font-weight: 500;
  letter-spacing: 0.2px;
}

.app-bar .logo-wordmark {
  height: 22px;
  width: auto;
  display: block;
}

.back-link {
  color: var(--cream);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 100px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 16px;
}

label:first-child { margin-top: 0; }

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fafbfd;
  color: var(--text);
}

/* Password fields can pick up extra native browser chrome (e.g. a built-in
   reveal-password control) that overrides padding/height even when the CSS
   above matches other inputs exactly. Force consistent custom rendering. */
input[type="password"] {
  -webkit-appearance: none;
  appearance: none;
  line-height: normal;
}

textarea { min-height: 120px; resize: vertical; font-family: inherit; }

.radio-row {
  display: flex;
  gap: 20px;
  align-items: center;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 500;
  color: var(--text);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
}

.checkbox-row input { margin-top: 3px; }

.checkbox-row span { font-size: 14px; line-height: 1.4; }

input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.checkbox-row:has(input:disabled) {
  opacity: 0.5;
}

.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

.topic-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--brand);
  color: white;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 22px;
}

.btn-primary:disabled { background: #e3c3aa; cursor: not-allowed; }

.btn-secondary {
  padding: 12px 18px;
  background: var(--cream);
  color: var(--dark);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
}

.btn-row { display: flex; gap: 10px; margin-top: 18px; }
.btn-row button { flex: 1; }

.btn-record {
  padding: 16px;
  background: var(--brand);
  color: white;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-record.recording { background: var(--danger); }

.status-line {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  min-height: 18px;
}

.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger);
  display: inline-block;
  animation: pulse 1.2s infinite;
}

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.data-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  min-height: 80px;
  font-size: 14px;
}

.data-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.data-row:last-child { border-bottom: none; }
.data-row .k { color: var(--muted); flex: 1; min-width: 0; }
.data-row .v { font-weight: 600; text-align: right; flex: 1; min-width: 0; }
.data-row input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fafbfd;
}
.data-row .row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.data-row .icon-btn {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--cream);
  color: var(--dark);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.data-row .icon-btn.delete { background: #fdecea; color: var(--danger); }

.empty-state { color: var(--muted); text-align: center; padding: 20px 0; font-size: 14px; }

.note-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.note-card .date { font-size: 13px; color: var(--muted); }
.note-card .preview { font-size: 14px; margin-top: 4px; color: var(--text); }

.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(192,111,51,0.4);
  text-decoration: none;
}

.rtl { direction: rtl; text-align: right; }

.lang-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.error-banner {
  background: #fdecea;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

.error-banner.show { display: block; }

.success-banner {
  background: #e8f5ee;
  color: var(--success);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  display: none;
}

.success-banner.show { display: block; }

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  background: #eef1f8;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
