* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100vh; }

body {
  font-family: 'Quicksand', system-ui, sans-serif;
  background: url('/cabin-bg.jpg') center/cover no-repeat fixed;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 28px;
  padding: 40px 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  max-width: 520px;
  width: 100%;
  text-align: center;
  animation: slideIn 0.5s ease-out;
}

.logout-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s, background 0.2s;
}

.logout-btn:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

h1 {
  font-family: 'Caveat', cursive;
  color: #5d3a1a;
  font-size: 52px;
  margin-bottom: 4px;
  font-weight: 700;
  text-shadow: 0 2px 0 rgba(255,255,255,0.6);
}

.subtitle {
  font-family: 'Caveat', cursive;
  color: #7a5230;
  font-size: 24px;
  margin-bottom: 32px;
}

.button-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn {
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(135deg, #8b6f47 0%, #6b4f2c 100%);
  color: white;
  border: none;
  padding: 18px 28px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s;
  box-shadow: 0 6px 18px rgba(107, 79, 44, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(107, 79, 44, 0.55);
}

.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #d2691e 0%, #a0522d 100%);
  box-shadow: 0 6px 18px rgba(210, 105, 30, 0.5);
  font-size: 20px;
  padding: 22px 28px;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 10px 22px rgba(210, 105, 30, 0.65);
}

.icon { font-size: 24px; }

.status {
  margin-top: 22px;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  color: #444;
  min-height: 22px;
  white-space: pre-line;
}

.result {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 15px;
  animation: fadeIn 0.25s ease;
  text-align: left;
  white-space: pre-line;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast.ok    { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.toast.warn  { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.toast.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.auth-blurb {
  font-family: 'Quicksand', sans-serif;
  color: #555;
  font-size: 15px;
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input {
  font-family: 'Quicksand', sans-serif;
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5em;
  padding: 18px 20px 18px 28px;
  border: 2px solid #c9a87a;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  color: #5d3a1a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  border-color: #8b6f47;
  box-shadow: 0 0 0 4px rgba(139, 111, 71, 0.18);
}

.working {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: fadeIn 0.2s ease;
}

.working[hidden] { display: none; }

.working-card {
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 360px;
  width: calc(100% - 40px);
}

.working-gif {
  width: 100%;
  max-width: 280px;
  border-radius: 12px;
  display: block;
  margin: 0 auto 14px;
}

.working-text {
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #333;
  white-space: pre-line;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
}

@media (max-width: 480px) {
  h1 { font-size: 42px; }
  .subtitle { font-size: 20px; margin-bottom: 24px; }
  .container { padding: 30px 22px; }
  .btn { font-size: 16px; padding: 16px 22px; }
  .btn-primary { font-size: 18px; padding: 18px 22px; }
}

.version-info {
  position: fixed;
  bottom: 8px;
  left: 0;
  right: 0;
  z-index: 1;
  text-align: center;
  font-family: 'Quicksand', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  letter-spacing: 0.02em;
}

.version-info:empty { display: none; }
