/* === Reset & Variablen === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  --gold: #A18730;
  --green-dark: #7D8736;
  --green-light: #89AD68;
  --cream-light: #e8efe0;
  --cream-warm: #f5f0e8;
  --brown-dark: #3d3220;
  --brown-mid: #5a4a35;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === Screens === */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, var(--cream-light) 0%, var(--cream-warm) 100%);
}

/* === Zweige-Dekoration === */
.zweige-top, .zweige-bottom {
  width: 100%;
  display: block;
  max-height: 90px;
  object-fit: cover;
  object-position: center;
}
.zweige-bottom { transform: scaleY(-1); }

/* === Gemeinsame Inhalts-Container === */
.pw-inner, .main-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px 16px;
  text-align: center;
}

/* === Ornament & Überschriften === */
.ornament {
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 12px;
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  color: var(--brown-dark);
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 8px;
}

.subtitle-tag {
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--green-dark);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* === Passwort-Screen: Bergillustration === */
.mountain-hero {
  width: min(280px, 75vw);
  height: auto;
  margin-bottom: 24px;
}

/* === Trennlinie === */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(200px, 75vw);
  margin-bottom: 24px;
}
.divider hr { flex: 1; border: none; border-top: 1px solid var(--gold); opacity: 0.5; }
.divider span { color: var(--gold); font-size: 0.75rem; }

/* === Passwort-Formular === */
.pw-label {
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.68rem;
  color: #6b6b6b;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pw-input {
  width: min(280px, 80vw);
  padding: 13px 20px;
  border: 1.5px solid #c5b99a;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  font-family: -apple-system, Arial, sans-serif;
  font-size: 1rem;
  color: #555;
  text-align: center;
  letter-spacing: 4px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pw-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(161, 135, 48, 0.15);
}
.pw-input.shake { animation: shake 0.4s ease; }

.pw-btn {
  width: min(280px, 80vw);
  padding: 13px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  cursor: pointer;
  transition: outline 0.2s;
}
.pw-btn:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.pw-error {
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.82rem;
  color: #c0392b;
  min-height: 1.4em;
}

/* === Buttons === */
.btn-gold, .btn-outline {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 6px;
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.84rem;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.1s, outline 0.2s;
  border: none;
}
.btn-gold { background: var(--gold); color: white; }
.btn-outline {
  border: 1.5px solid var(--gold);
  color: var(--gold);
  background: transparent;
}
.btn-gold:hover, .btn-outline:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}
.btn-gold:focus, .btn-outline:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* === Hauptseite: Intro-Text === */
.intro-text {
  max-width: 580px;
  width: 100%;
  background: rgba(255, 255, 255, 0.58);
  border-radius: 10px;
  padding: 18px 22px;
  border-top: 2px solid var(--gold);
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.88rem;
  color: var(--brown-mid);
  line-height: 1.75;
  font-style: italic;
  margin-bottom: 4px;
}

/* === Bergsilhouette als Trenner === */
.mountain-divider {
  width: 100%;
  max-width: 680px;
  height: 55px;
  display: block;
  margin-bottom: 20px;
}

/* === Schritt-Karten === */
.steps {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-card {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 12px;
  padding: 20px 22px;
  border-left: 3px solid var(--gold);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-align: left;
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: var(--delay, 0ms);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: white;
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-content { flex: 1; }

.step-content h3 {
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brown-dark);
  margin-bottom: 6px;
}

.step-content p {
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.82rem;
  color: #777;
  line-height: 1.55;
  margin-bottom: 12px;
}

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* === Upload-Bereich === */
.upload-area {
  border: 2px dashed #c5b99a;
  border-radius: 10px;
  padding: 24px 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-area:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.upload-area.drag-over {
  border-color: var(--gold);
  background: rgba(161, 135, 48, 0.08);
}

.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.82rem;
  color: #6b6b6b;
}
.upload-icon {
  font-size: 1.6rem;
  color: var(--green-dark);
  margin-bottom: 4px;
  display: block;
}
.upload-prompt strong {
  display: block;
  color: var(--green-dark);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
}

/* === Fortschrittsbalken === */
.upload-progress {
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.82rem;
  color: #888;
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: #e0d5c0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  width: 0%;
  transition: width 0.15s;
}

/* === Upload Status === */
.upload-success {
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.9rem;
  color: #27ae60;
  font-weight: 600;
}
.upload-error {
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.82rem;
  color: #c0392b;
  margin-top: 6px;
}

.hidden { display: none !important; }

/* === Namensfeld im Upload-Schritt === */
.name-label {
  display: block;
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.68rem;
  color: #6b6b6b;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
  margin-top: 4px;
}

.name-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #c5b99a;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.name-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(161, 135, 48, 0.15);
}
.name-input.error {
  border-color: #c0392b;
}

/* === Upload-Bereich deaktiviert === */
.upload-area--disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

/* === Dateigrößen-Hinweis === */
.upload-hint {
  font-size: 0.74rem;
  color: #aaa;
  margin-top: 2px;
}

/* === Dateiliste === */
.file-list {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.8rem;
}

.file-item__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brown-mid);
  min-width: 0;
}

.file-item__bar {
  width: 80px;
  height: 5px;
  background: #e0d5c0;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.file-item__fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  width: 0%;
  transition: width 0.15s;
}

.file-item__status {
  width: 48px;
  font-size: 0.75rem;
  text-align: right;
  flex-shrink: 0;
  color: #999;
}
.file-item__status--done { color: #27ae60; font-weight: 600; }
.file-item__status--error { color: #c0392b; }

.file-item__remove {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: #bbb;
  padding: 0 2px;
}
.file-item__remove:hover { color: #c0392b; }
.file-item__remove:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

.upload-submit {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  font-size: 0.9rem;
}

.file-item--uploading .file-item__bar {
  animation: upload-pulse 1.2s ease-in-out infinite;
}
.file-item--uploading .file-item__fill {
  width: 100%;
  transition: none;
}
@keyframes upload-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.upload-running {
  font-family: -apple-system, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--green-dark);
  text-align: center;
  margin-top: 10px;
}

/* === Berge.png am Seitenende === */
.berge-footer {
  width: 100%;
  max-width: 680px;
  margin-top: 32px;
  position: relative;
  overflow: hidden;
}
.berge-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(to bottom, var(--cream-warm), transparent);
  z-index: 1;
  pointer-events: none;
}
.berge-footer img {
  width: 100%;
  display: block;
  opacity: 0.5;
  mix-blend-mode: multiply;
}

/* === Animationen === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

/* === Responsive === */
@media (max-width: 480px) {
  .pw-inner, .main-inner { padding: 20px 16px 12px; }
  .step-card { padding: 16px; gap: 12px; }
  .intro-text { padding: 14px 16px; }
  .file-item__bar { width: 55px; }
}
