/* Nutty About Hosting — FileShare styles */

:root {
  --nah-orange: #FF6600;
  --nah-orange-dark: #e25a00;
  --nah-coral: #E54360;
  --nah-purple: #7B5EA7;
  --nah-aubergine: #3D2044;
  --nah-grey: #999999;
  --ink: #3D2044;
  --bg: #FAF8FA;
  --card: #FFFFFF;
  --line: #EEE8EF;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(61, 32, 68, 0.08);
  --grad: linear-gradient(90deg, var(--nah-orange), var(--nah-coral));
  --font: 'Proxima Nova Soft', 'Nunito', 'Varela Round', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win, even over display rules below. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  display: block;
  height: 5px;
  background: var(--grad);
}

a { color: var(--nah-orange); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }

.muted { color: var(--nah-grey); }

/* ---------- Brand ---------- */
.logo-mark, .logo-full { display: block; }
.brand-light {
  font-weight: 300;
  letter-spacing: .22em;
  color: var(--nah-grey);
  font-size: .72rem;
  text-transform: uppercase;
}
.brand-bold {
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--nah-orange);
  font-size: 1.05rem;
  text-transform: uppercase;
}
.tagline {
  font-weight: 300;
  letter-spacing: .3em;
  font-size: .68rem;
  text-transform: uppercase;
  color: var(--nah-grey);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: .7rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .7rem; }
.brand:hover { text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: .4rem; }
.nav-link {
  padding: .45rem .9rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--ink);
  font-size: .92rem;
}
.nav-link:hover { background: #F6EFF7; text-decoration: none; }
.nav-link.active { background: var(--nah-aubergine); color: #fff; }
.user-button { margin-left: .5rem; min-width: 32px; min-height: 32px; }

/* ---------- Layout ---------- */
.page-main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.2rem 3.5rem;
  flex: 1;
}
.hero { margin-bottom: 1.6rem; max-width: 640px; }
.hero p { color: #6e5e74; margin: 0; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--nah-orange);
  padding: 1.4rem;
  margin-bottom: 1.4rem;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.card-head h2 { margin: 0; }

/* Share-link landing page (click to download) */
.download-card {
  max-width: 460px;
  margin: 2.4rem auto;
  text-align: center;
  padding: 2rem 1.6rem 1.8rem;
}
.download-card .dl-art { display: flex; justify-content: center; margin-bottom: .5rem; }
.dl-title { margin: .2rem 0 1.2rem; }
.dl-name { font-weight: 700; word-break: break-word; margin: 0 0 .3rem; }
.dl-meta { margin: 0 0 1.5rem; }
.download-card .btn-lg { display: inline-block; }
.dl-hint { margin: 1.1rem 0 0; font-size: .85rem; }

/* ---------- Buttons & inputs ---------- */
.btn {
  font-family: var(--font);
  font-weight: 700;
  font-size: .92rem;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: .55rem 1.3rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
  display: inline-block;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .32rem .85rem; font-size: .82rem; }
.btn-lg { padding: .8rem 2.4rem; font-size: 1.05rem; }
.btn-primary { background: var(--nah-orange); color: #fff; }
.btn-primary:hover { background: var(--nah-orange-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: #fff; color: var(--nah-orange); border-color: var(--nah-orange); }
.btn-ghost:hover { background: #FFF3EA; }
.btn-danger-ghost { background: #fff; color: #C0392B; border-color: #E8C7C2; }
.btn-danger-ghost:hover { border-color: #C0392B; background: #FBF0EE; }

.input {
  font-family: var(--font);
  font-size: .95rem;
  padding: .6rem .9rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  width: 100%;
  color: var(--ink);
  background: #fff;
}
.input:focus { outline: none; border-color: var(--nah-orange); }
.input-search { max-width: 320px; }

/* ---------- Dropzone ---------- */
.dropzone-card { padding: 1rem; }
.dropzone {
  border: 2.5px dashed #F0C9AC;
  border-radius: 14px;
  text-align: center;
  padding: 2.4rem 1.5rem 2rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #FFFDFB;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragging {
  border-color: var(--nah-orange);
  background: #FFF6EE;
  outline: none;
}
.dropzone-art { opacity: .9; margin-bottom: .4rem; }
.dropzone-title { font-size: 1.15rem; font-weight: 700; margin: .2rem 0; }
.dropzone-sub { color: var(--nah-grey); margin: .2rem 0 .8rem; }
.note-row { margin-top: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.retention-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .88rem;
  font-weight: 600;
  flex-wrap: wrap;
}
.input-retention { width: auto; padding: .35rem .7rem; }
.retention-hint { color: var(--nah-grey); font-weight: 400; }

/* ---------- Upload rows ---------- */
.upload-list { margin-bottom: 1.4rem; }
.upload-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
  margin-bottom: .8rem;
  border-top-color: var(--nah-purple);
}
.upload-row .progress { grid-column: 1 / -1; }
.upload-info { display: flex; flex-direction: column; min-width: 0; }
.upload-name { font-weight: 700; word-break: break-all; }
.upload-status { font-size: .84rem; color: var(--nah-grey); }
.upload-row.done .upload-status { color: #2E7D32; font-weight: 700; }
.upload-row.failed .upload-status { color: #C0392B; font-weight: 700; }
.upload-actions { display: flex; gap: .4rem; }

.progress {
  height: 10px;
  border-radius: 999px;
  background: #F3EBF4;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--grad);
  transition: width .25s ease;
}

/* ---------- File list ---------- */
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem .4rem;
  border-bottom: 1px solid var(--line);
}
.file-row:last-child { border-bottom: none; }
.file-meta { min-width: 0; flex: 1 1 auto; }
.file-name { font-weight: 700; word-break: break-all; }
.file-sub { display: block; font-size: .84rem; color: var(--nah-grey); }
.file-row.partial .file-sub strong { color: var(--nah-coral); font-weight: 700; }
.file-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.file-check { width: 17px; height: 17px; flex-shrink: 0; cursor: pointer; }
.empty { color: var(--nah-grey); text-align: center; padding: 1.5rem 0; }

/* Multi-select toolbar (client list + admin table) */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .55rem .85rem;
  margin-bottom: .9rem;
  background: #FBF5EF;
  border: 1.5px solid #F0E1D2;
  border-radius: 12px;
}
.bulk-all { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .9rem; cursor: pointer; }
.bulk-count { color: var(--nah-grey); font-weight: 600; font-size: .88rem; }
.bulk-bar [data-bulk-delete] { margin-left: auto; }
.t-check { width: 1%; white-space: nowrap; text-align: center; }
input[type="checkbox"] { accent-color: var(--nah-orange); }
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Admin ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.stat-card {
  background: var(--nah-aubergine);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.stat-value { color: #fff; font-size: 1.7rem; font-weight: 800; }
.stat-label {
  color: rgba(255, 255, 255, .65);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
}

.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
  font-family: var(--font);
  font-weight: 700;
  font-size: .92rem;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: .45rem 1.2rem;
  cursor: pointer;
}
.tab.active { background: var(--nah-orange); border-color: var(--nah-orange); color: #fff; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--nah-grey);
  padding: .5rem .6rem;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.table td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.t-right { text-align: right; white-space: nowrap; }

.file-client { color: var(--nah-purple); font-weight: 600; }

.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.badge-ok { background: #E7F4E8; color: #2E7D32; }
.badge-warn { background: #FFF1E5; color: var(--nah-orange-dark); }
.badge-off { background: #F0EDF1; color: var(--nah-grey); }
.badge-brand { background: var(--nah-purple); color: #fff; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(61, 32, 68, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  border-top: 4px solid var(--nah-orange);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  width: 100%;
  max-width: 480px;
  padding: 1.6rem;
}
.modal h3 { margin-top: 0; }
.modal-file { color: var(--nah-grey); font-size: .9rem; margin-top: -.3rem; word-break: break-all; }
.field { display: block; margin-bottom: .9rem; }
.field span { display: block; font-weight: 700; font-size: .86rem; margin-bottom: .3rem; }
.field small { color: var(--nah-grey); font-weight: 400; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.field-check { display: flex; align-items: flex-start; gap: .55rem; }
.field-check input { margin-top: .2rem; flex-shrink: 0; }
.field-check span { font-weight: 600; font-size: .9rem; }
.drop-hint { font-size: .88rem; margin: -.4rem 0 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }
.link-result {
  background: #FFF6EE;
  border: 1.5px solid #F4D2B5;
  border-radius: 12px;
  padding: .8rem;
  font-size: .88rem;
  font-weight: 700;
}
.link-copy-row { display: flex; gap: .5rem; margin-top: .4rem; }
.link-copy-row .input { font-size: .82rem; font-weight: 400; }

/* ---------- Toasts ---------- */
#toast-root {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: center;
}
.toast {
  background: var(--nah-aubergine);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  padding: .65rem 1.3rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s, transform .3s;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #2E7D32; }
.toast-error { background: #C0392B; }

/* ---------- Spinner / loading ---------- */
.spinner {
  width: 34px;
  height: 34px;
  margin: 1.5rem auto;
  border-radius: 50%;
  border: 4px solid #F3E3D4;
  border-top-color: var(--nah-orange);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { flex: 1; display: flex; align-items: center; justify-content: center; padding: 4rem 0; }

/* ---------- Dark pages (login, download errors) ---------- */
.page-dark {
  background: var(--nah-aubergine);
  color: #fff;
}
.page-dark::before { background: var(--grad); }
.page-dark .tagline { color: rgba(255, 255, 255, .5); }
.arch-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 110%, rgba(255, 102, 0, .14) 0 18%, transparent 19%),
    radial-gradient(circle at 88% -8%, rgba(123, 94, 167, .25) 0 22%, transparent 23%),
    radial-gradient(circle at 75% 115%, rgba(229, 67, 96, .12) 0 15%, transparent 16%);
}

.page-login { align-items: center; justify-content: center; display: flex; }
.login-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding: 3rem 1.2rem;
  text-align: center;
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.login-logo-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.1rem 1.7rem .9rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .3);
  border-bottom: 4px solid var(--nah-orange);
}
.login-sub { color: rgba(255, 255, 255, .75); margin: 0; }
.signin-card { min-height: 100px; }
.login-help { color: rgba(255, 255, 255, .65); font-size: .88rem; line-height: 1.6; }
.login-help a { color: var(--nah-orange); }

.error-card {
  margin: auto;
  max-width: 460px;
  text-align: center;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  align-items: center;
}
.error-card h1 { color: #fff; }
.error-card p { color: rgba(255, 255, 255, .8); margin: 0; }
.error-help { font-size: .9rem; }
.error-card a { color: var(--nah-orange); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--nah-aubergine);
  color: rgba(255, 255, 255, .8);
  margin-top: auto;
  position: relative;
  overflow: hidden;
}
.site-footer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--grad);
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.2rem 2.2rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  align-items: center;
  text-align: center;
}
.footer-brand { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.footer-brand .brand-light { color: rgba(255, 255, 255, .55); }
.footer-contact { display: flex; gap: 1.4rem; flex-wrap: wrap; justify-content: center; }
.footer-contact a { color: rgba(255, 255, 255, .85); }
.footer-legal { font-size: .76rem; color: rgba(255, 255, 255, .45); line-height: 1.6; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  /* Keep the checkbox inline with the file name; wrap actions to their own row */
  .file-row { flex-wrap: wrap; align-items: center; gap: .5rem .6rem; }
  .file-meta { flex: 1 1 60%; }
  .file-actions { width: 100%; justify-content: flex-end; }
  .field-row { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; }
  .upload-row { grid-template-columns: 1fr; }
  .upload-actions { justify-content: flex-end; }
}
