/* Xpedient Downloads — themed to match the Management Portal
   (colors from xpedientsoftware.com, mirrored from portal-ui). */
:root {
  --navy: #1B2A4A;       /* primary   */
  --blue: #116DFF;       /* secondary */
  --blue-hover: #0a57d6;
  --accent: #E8492A;     /* accent    */

  --bg-top: #f0f4f8;
  --bg-bottom: #e2e8f0;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1B2A4A;
  --muted: #64748b;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;

  --radius: 10px;
  --shadow: 0 4px 16px rgba(27, 42, 74, 0.08);
  --shadow-hover: 0 6px 20px rgba(27, 42, 74, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Ensure [hidden] always wins — .status/.file-card set display, which would
   otherwise override the user-agent [hidden] { display: none } rule. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
}

body {
  display: flex;
  flex-direction: column;
}

/* ---- header ---- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
}

.logo {
  height: 32px;
  display: block;
}

/* ---- main ---- */
.page {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px;
}

.page-head {
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---- panels / status ---- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.status {
  text-align: center;
  color: var(--muted);
  padding: 56px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.status.error {
  color: var(--danger-text);
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.status.error strong { color: var(--danger-text); }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---- breadcrumb / path ---- */
.path-crumb {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-all;
}

.path-crumb .count {
  color: var(--navy);
  font-weight: 600;
}

/* ---- file cards ---- */
.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.file-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.file-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(17, 109, 255, 0.1);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-icon svg { width: 22px; height: 22px; }

.file-meta {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  color: var(--navy);
  word-break: break-all;
  margin-bottom: 2px;
}

.file-detail {
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.download-btn {
  flex: none;
  background: var(--blue);
  color: #fff;
  border: 0;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.download-btn:hover,
.download-btn:focus {
  background: var(--blue-hover);
}

/* ---- footer ---- */
.site-footer {
  text-align: center;
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.site-footer p { margin: 0; }
.site-footer .copyright { margin-top: 4px; font-size: 12px; color: #94a3b8; }

/* ---- responsive ---- */
@media (max-width: 540px) {
  .file-card { flex-wrap: wrap; }
  .download-btn { width: 100%; text-align: center; }
  .site-header, .page { padding-left: 16px; padding-right: 16px; }
}
