/* =============================================================
   DocuFire Web Portal — theme
   Colors pulled from the DocuFire app icon: dark navy background,
   fire-orange gradient accent, white foreground details.
   ============================================================= */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f1f3;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #e0e1e4;
  --accent: #e8541c;
  --accent-hover: #d3491a;
  --accent-text: #ffffff;
  --danger: #d92626;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg: #14171f;
  --surface: #1c2029;
  --surface-2: #242935;
  --text: #f2f2f2;
  --text-muted: #9aa0ad;
  --border: #2e333f;
  --accent: #f0651f;
  --accent-hover: #ff7a30;
  --accent-text: #ffffff;
  --danger: #ff6b6b;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.15s ease, color 0.15s ease;
}

/* ---- Header ---- */

.topbar {
  background: #14171f; /* always the brand navy, regardless of theme */
  color: #fff;
  padding: 0 24px;
}

.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}

.brand-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* CloudKit renders its own <button> inside this div — just make it
   fit the header visually. */
#apple-sign-out-button button {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: inline; }

/* ---- Layout ---- */

.centered {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 60px);
  padding: 24px;
}

.card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.signin-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.card h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.muted {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.primary-btn {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
}

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

.primary-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
}

.status-message {
  margin-top: 16px;
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
}

.status-message.info {
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

#app {
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.case-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-card {
  background: var(--surface);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
  border-left: 3px solid var(--accent);
}

.case-card:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.case-card strong {
  color: var(--text);
}

#app .card {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}

#app .card h2 {
  margin-bottom: 16px;
}

#app label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 14px;
  margin-bottom: 4px;
}

#app input[type="text"],
#app textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface-2);
  color: var(--text);
  resize: vertical;
}

#app .primary-btn {
  margin-top: 20px;
}

.secondary-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0 0 12px 0;
}

.secondary-btn:hover {
  color: var(--accent);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#app .card + .card {
  margin-top: 16px;
}

.save-bar {
  position: sticky;
  bottom: 16px;
  text-align: center;
}
