/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:        #f2f2f5;
  --card:      #ffffff;
  --hdr:       #0f0f1a;
  --accent:    #e63946;
  --accent2:   #457b9d;
  --text:      #1d1d2e;
  --muted:     #888;
  --border:    #e0e0e8;
  --radius:    10px;
  --shadow:    0 2px 12px rgba(0,0,0,.08);
}
html { font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

/* ── Header ────────────────────────────────────────────────────────────────── */
.site-header { background: var(--hdr); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1000px; margin: 0 auto; padding: 0 24px;
                display: flex; align-items: center; height: 56px; gap: 24px; }
.header-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-text       { color: #fff; font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.logo-badge      { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
                   padding: 2px 7px; border-radius: 4px; letter-spacing: .5px; text-transform: uppercase; }
.logo-sub        { color: rgba(255,255,255,.5); font-size: 13px; margin-left: 4px; }
.header-logo-img { height: 28px; width: auto; display: block; }
.login-logo-img  { height: 36px; width: auto; display: block; }
.dl-logo-img     { height: 30px; width: auto; display: block; }
.header-nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav-link   { color: rgba(255,255,255,.65); padding: 6px 12px; border-radius: 6px;
              font-size: 14px; text-decoration: none; transition: color .15s, background .15s; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }
.nav-logout { color: rgba(255,255,255,.4); }
.nav-logout:hover { color: rgba(255,255,255,.7); }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
       padding: 10px 20px; border-radius: 7px; font-size: 15px; font-weight: 600;
       cursor: pointer; border: none; transition: opacity .15s, transform .1s;
       text-decoration: none; white-space: nowrap; }
.btn:hover { opacity: .88; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-outline  { background: transparent; color: var(--text); border: 2px solid var(--border); }
.btn-outline:hover { border-color: #bbb; }
.btn-danger   { background: #c0392b; color: #fff; }
.btn-sm       { padding: 6px 12px; font-size: 13px; }
.btn-lg       { padding: 14px 28px; font-size: 16px; }
.btn-full     { width: 100%; }
.mt-16        { margin-top: 12px; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.field        { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.field label  { font-size: 14px; font-weight: 600; color: #444; }
.field input, .field textarea, .field select {
  border: 1.5px solid var(--border); border-radius: 7px; padding: 10px 14px;
  transition: border-color .15s; background: #fafafa; color: var(--text); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent2); background: #fff; }
.field textarea { resize: vertical; min-height: 100px; }
.field-hint   { font-size: 12px; color: var(--muted); }
.req          { color: var(--accent); }
.form-row     { display: grid; grid-template-columns: 1fr 220px; gap: 16px; }
.form-row .field-grow { grid-column: auto; }
.form-actions { margin-top: 8px; }

/* ── Dropzone ───────────────────────────────────────────────────────────────── */
.dropzone { border: 2px dashed var(--border); border-radius: 8px; padding: 24px;
            transition: border-color .15s, background .15s; cursor: default; }
.dropzone.drag-over { border-color: var(--accent2); background: rgba(69,123,157,.05); }
.dropzone.has-files { border-style: solid; border-color: #ccc; }
.dropzone input[type=file] { display: none; }
.dropzone-hint { display: flex; flex-direction: column; align-items: center; gap: 6px;
                 color: var(--muted); font-size: 14px; padding: 8px 0; }
.drop-icon  { font-size: 28px; }
.dropzone.has-files .dropzone-hint { display: none; }
.link { color: var(--accent2); cursor: pointer; text-decoration: underline; }
.file-list  { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.file-item  { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
              background: var(--bg); border-radius: 6px; font-size: 14px; }
.file-name  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size  { color: var(--muted); font-size: 12px; white-space: nowrap; }
.file-remove { border: none; background: none; cursor: pointer; color: #bbb; font-size: 18px;
               line-height: 1; padding: 0 4px; }
.file-remove:hover { color: var(--accent); }

/* ── Radio Group ────────────────────────────────────────────────────────────── */
.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-label { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px;
               border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer;
               transition: border-color .15s, background .15s; }
.radio-label:hover { border-color: #bbb; }
.radio-label.active { border-color: var(--accent2); background: rgba(69,123,157,.05); }
.radio-label input[type=radio] { display: none; }
.radio-mark { width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 50%;
              flex-shrink: 0; margin-top: 2px; transition: border-color .15s; }
.radio-label.active .radio-mark { border-color: var(--accent2); border-width: 5px; }
.radio-label strong { display: block; font-size: 15px; margin-bottom: 3px; }
.radio-hint { font-size: 13px; color: var(--muted); }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 7px; font-size: 14px; margin-bottom: 20px; }
.alert-error { background: #fff0f0; border: 1px solid #fbbcbc; color: #9b1c1c; }
.alert-success { background: #f0fff4; border: 1px solid #a3e6b0; color: #1a6832; }

/* ── Success Card ───────────────────────────────────────────────────────────── */
.success-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
                padding: 40px 32px; text-align: center; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: #e8f5e9;
                display: flex; align-items: center; justify-content: center;
                font-size: 28px; color: #2e7d32; margin: 0 auto 20px; }
.success-card h2 { margin-bottom: 12px; }
.success-card .btn { margin: 6px; }
.link-box { display: flex; gap: 8px; margin: 16px 0; }
.link-box input { flex: 1; background: var(--bg); border: 1.5px solid var(--border);
                  border-radius: 7px; padding: 10px 14px; font-size: 14px; color: var(--text); }

/* ── Dashboard ──────────────────────────────────────────────────────────────── */
.page-title { font-size: 22px; font-weight: 700; }
.dash-head  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.table-wrap { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dash-table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border);
                  font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.dash-table td { padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr.row-deleted td { opacity: .45; }
.dash-table tr.row-expired td { background: #fff8f8; }
.td-subject { font-weight: 600; margin-bottom: 3px; }
.td-link    { font-size: 12px; color: var(--accent2); }
.td-small   { font-size: 13px; color: #555; }
.td-subline { font-size: 12px; color: var(--muted); margin-top: 3px; }
.td-actions { white-space: nowrap; }
.muted      { color: var(--muted); }
.text-red   { color: #c0392b; }
.text-orange { color: #e67e22; }
.empty-state { padding: 40px; text-align: center; color: var(--muted); }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px;
         border-radius: 4px; white-space: nowrap; }
.badge-green { background: #d4edda; color: #155724; }
.badge-blue  { background: #d1ecf1; color: #0c5460; }
.badge-gray  { background: #e9ecef; color: #495057; }
.badge-teal  { background: #d0f0ea; color: #0e6655; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45);
         align-items: center; justify-content: center; z-index: 200; }
.modal.open { display: flex; }
.modal-box  { background: #fff; border-radius: var(--radius); padding: 32px;
              max-width: 420px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,.15); }
.modal-box h3 { margin-bottom: 12px; }
.modal-box p  { color: #555; font-size: 14px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; }

/* ── Login ──────────────────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box  { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
              padding: 40px 36px; width: 100%; max-width: 380px; }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }

/* ── Upload Progress ────────────────────────────────────────────────────────── */
.progress-wrap    { padding: 16px 0 8px; text-align: center; }
.progress-icon    { font-size: 36px; margin-bottom: 12px; animation: bounce .8s infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-6px); } }
.progress-wrap h2 { margin-bottom: 24px; font-size: 20px; }
.progress-bar-track { height: 14px; background: var(--border); border-radius: 99px;
                      overflow: hidden; margin-bottom: 12px; }
.progress-bar-fill  { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent));
                      border-radius: 99px; transition: width .3s ease; }
.progress-meta      { display: flex; justify-content: space-between; font-size: 13px;
                      color: var(--muted); margin-bottom: 8px; }
#progPct            { font-weight: 700; color: var(--text); font-size: 15px; }
#progSpeed          { min-width: 80px; text-align: right; }
.progress-spinner   { width: 24px; height: 24px; border: 3px solid var(--border);
                      border-top-color: var(--accent2); border-radius: 50%;
                      animation: spin .7s linear infinite; margin: 12px auto 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Download Page ──────────────────────────────────────────────────────────── */
.download-page { display: flex; flex-direction: column; align-items: center;
                 justify-content: center; min-height: 100vh; padding: 24px; }
.download-wrap  { width: 100%; max-width: 480px; }
.download-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding: 0 4px; }
.download-card  { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
                  padding: 40px 36px; text-align: center; }
.download-card h1 { font-size: 22px; margin-bottom: 12px; }
.dl-icon { width: 72px; height: 72px; background: #e8f0fe; border-radius: 50%;
           display: flex; align-items: center; justify-content: center;
           font-size: 32px; color: var(--accent2); margin: 0 auto 20px; }
.dl-icon-error { background: #fde8e8; color: var(--accent); }
.dl-message { color: #555; font-size: 15px; margin-bottom: 20px; text-align: left; line-height: 1.6; }
.dl-meta    { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.dl-meta-row { display: flex; justify-content: space-between; align-items: center;
               padding: 12px 16px; font-size: 14px; }
.dl-meta-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.dl-meta-row span { color: var(--muted); }
.dl-hint    { font-size: 12px; color: var(--muted); margin-top: 14px; }
.download-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.download-footer a { color: var(--muted); }

font-size: 13px; color: var(--muted); }
.download-footer a { color: var(--muted); }

/* ── Download-Seite (neues Layout) ──────────────────────────────────────────── */
.dl-page { margin: 0; padding: 0; min-height: 100vh; overflow: hidden; }

.dl-bg {
  position: fixed; inset: 0; z-index: 0;
  background: url('/assets/download_bg.webp') center/cover no-repeat;
}
.dl-bg-overlay {
  position: fixed; inset: 0; z-index: 1;
  background: linear-gradient(to right, rgba(0,0,0,.15) 0%, rgba(0,0,0,.5) 100%);
}

/* Panel: auf Desktop rechts, auf Mobile zentriert */
.dl-panel {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}
.dl-panel-inner {
  width: 420px;
  max-width: 100%;
  background: rgba(15,15,26,.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.dl-brand       { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.dl-brand-logo  { height: 28px; width: auto; }

.dl-subject     { font-size: 26px; font-weight: 800; color: #fff;
                  line-height: 1.2; margin-bottom: 16px; letter-spacing: -.3px; }
.dl-msg         { font-size: 15px; color: rgba(255,255,255,.7); line-height: 1.6;
                  margin-bottom: 24px; }

.dl-info        { border: 1px solid rgba(255,255,255,.15); border-radius: 10px;
                  overflow: hidden; margin-bottom: 28px; }
.dl-info-row    { display: flex; justify-content: space-between; align-items: center;
                  padding: 13px 18px; font-size: 14px; }
.dl-info-row:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,.1); }
.dl-info-row span   { color: rgba(255,255,255,.55); }
.dl-info-row strong { color: #fff; font-weight: 600; }

.btn-dl {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: #fff; text-decoration: none;
  padding: 16px 28px; border-radius: 10px; font-size: 16px; font-weight: 700;
  transition: opacity .15s, transform .1s; margin-bottom: 14px;
}
.btn-dl:hover { opacity: .88; text-decoration: none; }
.btn-dl:active { transform: scale(.98); }
.btn-dl-icon  { font-size: 20px; line-height: 1; }

.btn-dl-outline {
  display: inline-block; border: 2px solid rgba(255,255,255,.4); color: rgba(255,255,255,.8);
  text-decoration: none; padding: 13px 24px; border-radius: 10px; font-size: 15px;
  font-weight: 600; transition: border-color .15s, color .15s; margin-bottom: 14px;
}
.btn-dl-outline:hover { border-color: rgba(255,255,255,.8); color: #fff; text-decoration: none; }

.dl-hint   { font-size: 12px; color: rgba(255,255,255,.4); margin-bottom: 40px; }
.dl-footer { font-size: 12px; color: rgba(255,255,255,.35); margin-top: auto; }
.dl-footer a { color: rgba(255,255,255,.4); text-decoration: none; }
.dl-footer a:hover { color: rgba(255,255,255,.7); }

/* Mobile: Panel nimmt volle Breite */
@media (max-width: 600px) {
  .dl-panel-inner { width: 100%; padding: 32px 24px; }
  .dl-subject { font-size: 22px; }
}

.dl-copyright { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 3; font-size: 11px; color: rgba(255,255,255,.45); white-space: nowrap;
  letter-spacing: .3px; text-shadow: 0 1px 3px rgba(0,0,0,.5); pointer-events: none; }

.dl-counter { display:flex; gap:8px; margin-top:5px; font-size:12px; }
.dl-counter-complete { color:#2e7d32; font-weight:600; }
.dl-counter-partial  { color:#b45309; font-weight:600; }
