/* ============================================================
   Download Hub – Patreon-inspiriertes Design
   ============================================================ */

:root {
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);

  /* Patreon Farben */
  --patreon-red:    #ff424d;
  --patreon-dark:   #052d49;
  --patreon-mid:    #0a3d5c;
  --patreon-light:  #e8f4fb;

  /* Hintergrund & Oberflächen */
  --bg:           #f4f5f6;
  --bg-white:     #ffffff;
  --bg-secondary: #f0f2f4;
  --border:       #e1e4e8;
  --border-light: #eaecef;

  /* Text */
  --text:           #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted:     #718096;

  /* Akzente */
  --accent:       #052d49;
  --accent-mid:   #0a3d5c;
  --accent-hover: #031e31;
  --accent-light: #e8f4fb;
  --gold:         #c99a2e;
  --gold-light:   #fdf8ec;
  --gold-border:  #e8d5a3;

  /* Status */
  --green:        #276749;
  --green-light:  #e6f6ee;
  --red:          #c53030;
  --red-light:    #fff5f5;
  --amber:        #c05621;
  --amber-light:  #fffaf0;

  /* Tier-Farben passend zu Patreon */
  --tier-1-bg: #f0f4f8; --tier-1-color: #4a5568; --tier-1-border: #cbd5e0;
  --tier-2-bg: #ebf8ff; --tier-2-color: #2b6cb0; --tier-2-border: #90cdf4;
  --tier-3-bg: #f0fff4; --tier-3-color: #276749; --tier-3-border: #9ae6b4;
  --tier-4-bg: #faf5ff; --tier-4-color: #6b46c1; --tier-4-border: #d6bcfa;
  --tier-5-bg: #fdf8ec; --tier-5-color: #c99a2e; --tier-5-border: #e8d5a3;

  --radius:    8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --transition: .15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-mid); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  background: var(--patreon-dark);
  border-bottom: 3px solid var(--gold);
  position: sticky; top: 0; z-index: 100;
}

.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem; height: 60px;
  display: flex; align-items: center; gap: 2rem;
}

.site-logo {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; color: #fff;
  display: flex; align-items: center; gap: .6rem; flex-shrink: 0;
}
.site-logo svg { color: var(--gold); }
.site-logo:hover { color: #fff; text-decoration: none; }

.header-nav { display: flex; gap: 1.5rem; }
.header-nav a { color: rgba(255,255,255,.7); font-size: .875rem; font-weight: 500; }
.header-nav a:hover { color: #fff; text-decoration: none; }

.header-user { margin-left: auto; display: flex; align-items: center; gap: .75rem; }

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; border: 2px solid rgba(255,255,255,.3);
}
.user-avatar--initials {
  background: var(--gold); color: var(--accent);
  font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: .875rem; color: rgba(255,255,255,.85); }

.btn-logout {
  font-size: .8rem; color: rgba(255,255,255,.75);
  padding: .3rem .75rem;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius-sm); transition: var(--transition);
}
.btn-logout:hover { color: #fff; border-color: rgba(255,255,255,.6); text-decoration: none; }

/* ============================================================
   PUBLIC HERO
   ============================================================ */

.public-hero {
  background: var(--patreon-dark);
  color: #fff; padding: 3.5rem 1.5rem;
  text-align: center;
  border-bottom: 3px solid var(--gold);
}

.public-hero__title {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 700; margin-bottom: .5rem;
}
.public-hero__sub {
  font-size: 1rem; color: rgba(255,255,255,.75);
  margin-bottom: 1.75rem;
  max-width: 520px; margin-left: auto; margin-right: auto;
}
.public-hero__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn-hero-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.75rem;
  background: var(--patreon-red); color: #fff;
  font-weight: 700; font-size: .95rem;
  border-radius: var(--radius); transition: var(--transition);
  box-shadow: 0 2px 8px rgba(255,66,77,.35);
}
.btn-hero-primary:hover {
  background: #e0323d; color: #fff; text-decoration: none;
  transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,66,77,.45);
}

.btn-hero-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.75rem;
  background: transparent; color: #fff;
  font-weight: 600; font-size: .95rem;
  border: 2px solid rgba(255,255,255,.4);
  border-radius: var(--radius); transition: var(--transition);
}
.btn-hero-ghost:hover {
  border-color: #fff; background: rgba(255,255,255,.1);
  color: #fff; text-decoration: none;
}

.tier-legend {
  display: flex; gap: .625rem; justify-content: center;
  flex-wrap: wrap; margin-top: 2rem;
  padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15);
}
.tier-legend__label {
  font-size: .72rem; color: rgba(255,255,255,.5);
  width: 100%; text-align: center; margin-bottom: .25rem;
  text-transform: uppercase; letter-spacing: .08em;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */

.site-main {
  flex: 1; max-width: 1200px; width: 100%;
  margin: 0 auto; padding: 2.5rem 1.5rem;
}

.site-footer {
  background: var(--patreon-dark);
  color: rgba(255,255,255,.5);
  text-align: center; padding: 1.5rem;
  font-size: .8rem; border-top: 3px solid var(--gold);
}
.site-footer a { color: rgba(255,255,255,.65); }

/* ============================================================
   LOGIN
   ============================================================ */

.login-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center; padding: 2rem;
  background: linear-gradient(160deg, var(--patreon-dark) 0%, var(--patreon-mid) 100%);
}

.login-card {
  width: 100%; max-width: 400px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 2.5rem; text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  border-top: 4px solid var(--patreon-red);
}

.login-logo {
  width: 64px; height: 64px;
  background: #fff5f5; border: 2px solid #fed7d7;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem; color: var(--patreon-red);
}

.login-title {
  font-family: var(--font-display); font-size: 1.5rem;
  font-weight: 700; color: var(--text); margin-bottom: .4rem;
}
.login-subtitle { color: var(--text-secondary); font-size: .9rem; margin-bottom: 1.75rem; }

.btn-patreon {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  width: 100%; padding: .875rem 1.5rem;
  background: var(--patreon-red); color: #fff;
  font-weight: 700; font-size: .95rem;
  border-radius: var(--radius); transition: var(--transition);
  box-shadow: 0 2px 8px rgba(255,66,77,.3);
}
.btn-patreon:hover {
  background: #e0323d; color: #fff; text-decoration: none;
  transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,66,77,.4);
}

.login-hint { margin-top: 1.25rem; font-size: .8rem; color: var(--text-muted); }

/* ============================================================
   DASHBOARD
   ============================================================ */

.dashboard { display: flex; flex-direction: column; gap: 2rem; }

.dashboard-header {
  display: grid; grid-template-columns: 1fr auto;
  gap: 1.5rem; align-items: start;
}
@media (max-width: 700px) { .dashboard-header { grid-template-columns: 1fr; } }

.quota-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--patreon-red);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: .875rem;
  box-shadow: var(--shadow);
}

.quota-info { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.quota-tier { display: flex; align-items: center; gap: .75rem; }
.quota-months { font-size: .8rem; color: var(--text-muted); }
.quota-numbers { font-size: .9rem; color: var(--text-secondary); display: flex; align-items: center; gap: .3rem; }
.quota-numbers strong { color: var(--text); font-weight: 700; }

.quota-bar-wrap { display: flex; align-items: center; gap: 1rem; }
.quota-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.quota-bar__fill { height: 100%; border-radius: 3px; transition: width .5s; }
.quota-bar__fill--ok      { background: var(--green); }
.quota-bar__fill--warning { background: var(--amber); }
.quota-bar__fill--danger  { background: var(--patreon-red); }
.quota-bar--sm { height: 4px; width: 80px; flex: none; }

.quota-remaining { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.quota-inline { display: flex; align-items: center; gap: .5rem; }

.recent-downloads {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  min-width: 240px; box-shadow: var(--shadow);
}

.section-label {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: .75rem;
}

.recent-list { list-style: none; display: flex; flex-direction: column; gap: .625rem; }
.recent-list li { display: flex; flex-direction: column; gap: .1rem; }
.recent-model { font-size: .875rem; font-weight: 500; color: var(--text); }
.recent-meta  { font-size: .775rem; color: var(--text-muted); }

/* ============================================================
   MODEL GRID
   ============================================================ */

.model-group { margin-bottom: 2.5rem; }

.group-title {
  font-family: var(--font-display); font-size: 1.1rem;
  font-weight: 700; margin-bottom: 1.25rem;
  padding-bottom: .625rem;
  border-bottom: 2px solid var(--accent-light);
  color: var(--accent);
  display: flex; align-items: center; gap: .5rem;
}
.group-title::before {
  content: ''; display: inline-block;
  width: 4px; height: 1.1rem;
  background: var(--patreon-red); border-radius: 2px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.model-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
  box-shadow: var(--shadow);
}
.model-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.model-card--locked { opacity: .93; }

.model-thumb {
  position: relative; aspect-ratio: 16/9;
  background: var(--bg-secondary); overflow: hidden;
}
.model-thumb img { width: 100%; height: 100%; object-fit: cover; }

.model-thumb__placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--accent-light) 0%, #dbeafe 100%);
}

.scale-badge {
  position: absolute; top: .5rem; right: .5rem;
  background: rgba(5,45,73,.85); color: #fff;
  font-size: .7rem; font-weight: 600;
  padding: .2rem .5rem; border-radius: 4px;
  backdrop-filter: blur(4px);
}

.tier-required-badge {
  position: absolute; top: .5rem; left: .5rem;
  font-size: .68rem; font-weight: 700;
  padding: .2rem .55rem; border-radius: 4px;
  backdrop-filter: blur(4px);
}

.model-body {
  padding: 1rem; flex: 1;
  display: flex; flex-direction: column; gap: .5rem;
}
.model-name { font-weight: 700; font-size: .95rem; color: var(--text); }
.model-desc {
  font-size: .825rem; color: var(--text-secondary); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.model-meta { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .25rem; }
.meta-tag {
  font-size: .72rem; padding: .2rem .5rem;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-muted);
}

.last-download { font-size: .75rem; color: var(--text-muted); margin-top: auto; padding-top: .5rem; }

.model-footer {
  padding: .75rem 1rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

.btn-download {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; padding: .625rem 1rem;
  background: var(--patreon-red); color: #fff;
  font-weight: 600; font-size: .875rem;
  border-radius: var(--radius-sm);
  border: none; cursor: pointer; transition: var(--transition);
  text-decoration: none;
}
.btn-download:hover { background: #e0323d; color: #fff; text-decoration: none; }

.btn-download--disabled {
  background: var(--bg-secondary); color: var(--text-muted);
  cursor: not-allowed; border: 1px solid var(--border);
}
.btn-download--quota {
  background: var(--amber-light); color: var(--amber);
  cursor: not-allowed; border: 1px solid #fbd38d;
}

.btn-unlock {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; padding: .55rem 1rem;
  background: transparent; color: var(--patreon-red);
  font-weight: 600; font-size: .82rem;
  border: 1.5px solid var(--patreon-red);
  border-radius: var(--radius-sm); transition: var(--transition);
  text-decoration: none;
}
.btn-unlock:hover { background: #fff5f5; color: #c0303a; text-decoration: none; }

.token-notice {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8rem; color: var(--text-muted);
  padding: .75rem 1rem;
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ============================================================
   PUBLIC INFO BAR
   ============================================================ */

.public-info-bar {
  background: var(--gold-light); border: 1px solid var(--gold-border);
  border-radius: var(--radius); padding: .875rem 1.25rem;
  display: flex; align-items: center; gap: .75rem;
  font-size: .875rem; color: #7d5a00; margin-bottom: 2rem;
}
.public-info-bar svg { flex-shrink: 0; color: var(--gold); }
.public-info-bar a { color: var(--accent); font-weight: 600; }

/* ============================================================
   TIER BADGES
   ============================================================ */

.tier-badge {
  display: inline-flex; align-items: center;
  font-size: .72rem; font-weight: 700;
  padding: .25rem .625rem; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}

.tier-s1 { background: var(--tier-1-bg); color: var(--tier-1-color); border: 1px solid var(--tier-1-border); }
.tier-s2 { background: var(--tier-2-bg); color: var(--tier-2-color); border: 1px solid var(--tier-2-border); }
.tier-s3 { background: var(--tier-3-bg); color: var(--tier-3-color); border: 1px solid var(--tier-3-border); }
.tier-s4 { background: var(--tier-4-bg); color: var(--tier-4-color); border: 1px solid var(--tier-4-border); }
.tier-s5 { background: var(--tier-5-bg); color: var(--tier-5-color); border: 1px solid var(--tier-5-border); }

/* ============================================================
   ALERTS & BUTTONS
   ============================================================ */

.alert {
  padding: .875rem 1.125rem; border-radius: var(--radius);
  font-size: .875rem; margin-bottom: 1.25rem; border-left: 4px solid;
}
.alert--success { background: var(--green-light); border-color: var(--green); color: #22543d; }
.alert--error   { background: var(--red-light);   border-color: var(--red);   color: #742a2a; }

.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1rem; font-size: .875rem; font-weight: 600;
  border-radius: var(--radius-sm); border: none; cursor: pointer;
  transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.btn--primary { background: var(--patreon-red); color: #fff; }
.btn--primary:hover { background: #e0323d; color: #fff; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn--ghost:hover { color: var(--text); background: var(--bg-secondary); text-decoration: none; border-color: #aaa; }
.btn--danger-ghost { background: transparent; color: var(--red); border: 1px solid transparent; }
.btn--danger-ghost:hover { border-color: var(--red); background: var(--red-light); text-decoration: none; }
.btn--sm { padding: .35rem .7rem; font-size: .8rem; }
.btn--full { width: 100%; justify-content: center; }

/* ============================================================
   FORMS
   ============================================================ */

.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group--grow { flex: 1; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }

.form-label {
  font-size: .82rem; font-weight: 600; color: var(--text-secondary);
  display: flex; align-items: center; gap: .5rem;
}

.form-input {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .6rem .875rem;
  color: var(--text); font-size: .875rem; font-family: inherit;
  transition: border-color var(--transition); width: 100%;
}
.form-input:focus { outline: none; border-color: var(--patreon-red); box-shadow: 0 0 0 3px rgba(255,66,77,.12); }
.form-input--sm { padding: .4rem .75rem; font-size: .8rem; }
.form-textarea { resize: vertical; min-height: 72px; }

.form-hint { font-size: .775rem; color: var(--text-muted); line-height: 1.4; }
.form-badge { font-size: .7rem; font-weight: 700; padding: .15rem .45rem; border-radius: 4px; display: inline-flex; align-items: center; gap: .3rem; }
.form-badge--secure { background: var(--green-light); color: var(--green); border: 1px solid #9ae6b4; }
.form-checkbox { display: flex; align-items: center; gap: .625rem; cursor: pointer; font-size: .875rem; color: var(--text-secondary); }
.form-checkbox input { width: 16px; height: 16px; accent-color: var(--patreon-red); }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; padding-top: .5rem; }
.required { color: var(--red); }

/* ============================================================
   ERROR PAGES
   ============================================================ */

.error-page {
  min-height: 70vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 1rem; padding: 2rem;
}
.error-code { font-family: var(--font-display); font-size: 5rem; font-weight: 700; color: var(--patreon-red); line-height: 1; }
.error-page h1 { font-size: 1.5rem; color: var(--text); }
.error-page p { color: var(--text-secondary); max-width: 400px; }
.error-icon { margin-bottom: .5rem; }

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 1rem; padding: 3rem; color: var(--text-muted); text-align: center;
}
.empty-state p { color: var(--text-secondary); }

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

/* ============================================================
   STATUS DOTS
   ============================================================ */

.status-dot { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 500; }
.status-dot::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.status-dot--active::before   { background: var(--green); }
.status-dot--inactive::before { background: var(--text-muted); }
