:root {
  --bg: #0f172a;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #36648b;
  --border: #e5e7eb;

  --ytg-green: #153009;
  --ytg-gold: #c7ae6a;

  --header-height: 120px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background-image: url("https://taschenuhr-herren.de/cdn/shop/articles/Taschenuhr_f59a2c39-9fb4-42aa-8da6-c8ff0bda67ff_1200x1200.jpg?v=1655577757");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background: rgba(15, 23, 42, 0.25);
}

/* Grundlayout */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
}

/* Grüner Header */
.app-header {
  height: var(--header-height);
  width: 100%;
  background-color: var(--ytg-green);

  display: flex;
  justify-content: center;
  align-items: center;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  z-index: 10;
}

.app-header-logo {
  max-height: 86px;
  max-width: min(82vw, 420px);
  object-fit: contain;
}

/* Hauptbereich */
.app-main {
  width: 100%;
  min-height: calc(100vh - var(--header-height));

  display: grid;
  place-items: start center;

  padding: clamp(36px, 7vh, 80px) 20px 20px;
}

.container-fluid {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Standard Login-Box */
.login-box {
  width: 360px;
  padding: 20px;
  margin: 0 20px;
  background-color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  text-align: center;
}

/* Breitere Dashboard-Box */
.login-box.dashboard-mode {
  width: min(96vw, 860px);
  max-width: 860px;
  padding: 24px;
  border-radius: 20px;
}

/* Header innerhalb Login */
.login-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  font-weight: bold;
  font-size: 18px;
  color: #333333;
  margin-bottom: 15px;
}

.login-logo img {
  height: 36px;
  max-width: 150px;
  object-fit: contain;
}

.login-divider {
  border-bottom: 1px solid #dddddd;
  margin-bottom: 15px;
}

/* Formularfelder */
.login-input {
  width: 100%;
  height: 45px;
  margin-bottom: 15px;
  padding: 0 10px;

  border: 1px solid #dddddd;
  border-radius: 4px;
  font: inherit;
}

/* Buttons allgemein */
.login-button,
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 45px;

  border: none;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-weight: bold;
}

/* Login-Button bleibt blau */
.login-button {
  background-color: var(--accent);
  color: #ffffff;
}

.login-button:hover,
.secondary-button:hover,
.dashboard-button:hover {
  filter: brightness(0.95);
}

.secondary-button {
  margin-top: 10px;
  background-color: #e5e7eb;
  color: #111827;
}

/* Dashboard-Buttons wie altes Dashboard: grün + gold */
.dashboard-button,
.login-box.dashboard-mode .login-button {
  width: 100%;
  min-height: 54px;

  background-color: var(--ytg-green);
  color: var(--ytg-gold);

  font-size: 1.25rem;
  font-weight: 700;

  border: none;
  border-radius: 20px;
  padding: 12px 16px;
  cursor: pointer;
}

/* Logout im Dashboard dezenter, aber gleiche Farbfamilie */
.login-box.dashboard-mode .secondary-button {
  width: 100%;
  min-height: 48px;

  background-color: var(--ytg-green);
  color: var(--ytg-gold);

  font-size: 1rem;
  font-weight: 700;

  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  margin-top: 14px;
}

/* Links */
.forgot-link {
  color: #007bff;
  text-decoration: none;
  font-size: 0.9em;
}

.forgot-link:hover {
  text-decoration: none;
}

/* Meldungen */
.alert {
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  text-align: left;
  font-size: 0.95rem;
}

.alert-danger {
  background: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
}

.alert-success {
  background: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
}

.message {
  margin-top: 14px;
  padding: 10px;
  border-radius: 6px;
  background: #eef2ff;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
}

.message.success {
  background: #dcfce7;
  color: #166534;
}

.hidden {
  display: none !important;
}

/* Scanner */
.scanner-box,
.scanner-area,
#qr-reader {
  width: 100%;
  min-height: 280px;

  border: 1px dashed #dddddd;
  border-radius: 8px;

  display: grid;
  place-items: center;

  margin-bottom: 15px;
  overflow: hidden;
  background: #f9fafb;
}

/* Dashboard */
.dashboard-box {
  width: 35vh;
  text-align: center;
  color: #020501;
}

.dashboard-time {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 700;
  color: #020501;
}

.dashboard-date {
  margin: 4px 0 18px;
  color: #020501;
  font-size: 1.8rem;
  font-weight: 700;
}

.dashboard-status {
  margin: 14px 0;
  font-size: 1.1rem;
}

.status-in {
  color: #198754;
}

.status-out {
  color: #dc3545;
}

.dashboard-worktime {
  margin: 20px 0;
  font-size: 2.4rem;
  line-height: 1.1;
  color: #020501;
}

.dashboard-toggle {
  cursor: pointer;
  text-align: center;
  margin: 20px auto;
  padding: 10px 16px;

  border: 1px solid var(--ytg-green);
  border-radius: 999px;

  color: var(--ytg-green);
  font-weight: 700;
  max-width: 240px;
  font-size: 0.95rem;
}

.today-times {
  text-align: center;
  margin-bottom: 20px;
  padding: 10px;

  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.today-times p {
  margin: 6px 0;
  font-size: 0.95rem;
}

.dashboard-action-row {
  margin-top: 18px;
}

/* Footer */
.app-footer-text {
  margin-top: 30px;
  margin-bottom: 0;
  color: #6c757d;
  font-size: 0.9rem;
}

/* Noscript */
.noscript {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 9999;

  padding: 12px;
  background: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
  border-radius: 6px;
  text-align: center;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 5% 10%;
}
#reader {
  width: 100%;
  height: 100%;
}
#result {
  text-align: center;
  font-size: 1.5rem;
}

#success {
top: 0;
}



/* Tablet */
@media (max-width: 768px) {
  :root {
    --header-height: 110px;
  }

  .app-header-logo {
    max-height: 76px;
    max-width: 86vw;
  }

  .login-box {
    width: 90%;
  }

  .login-box.dashboard-mode {
    width: 92%;
    max-width: 520px;
  }

  .dashboard-time {
    font-size: 2.2rem;
  }

  .dashboard-date {
    font-size: 1.5rem;
  }

  .dashboard-worktime {
    font-size: 2.2rem;
  }
}

/* Smartphone */
@media (max-width: 480px) {
  :root {
    --header-height: 96px;
  }

  .app-main {
    padding: 28px 14px 14px;
  }

  .app-header-logo {
    max-height: 66px;
  }

  .login-box {
    width: 90%;
    margin: 0;
  }

  .login-box.dashboard-mode {
    width: 100%;
    max-width: none;
    padding: 10px;
  }

  .login-logo img {
    height: 32px;
  }

  .dashboard-time {
    font-size: 2rem;
  }

  .dashboard-date {
    font-size: 1.25rem;
  }

  .dashboard-worktime {
    font-size: 2rem;
  }

  .dashboard-button,
  .login-box.dashboard-mode .login-button {
    font-size: 1.15rem;
  }
}