@font-face {
  font-family: 'Nunito';
  src: url('../fonts/Nunito-VariableFont_wght.ttf') format('truetype');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('../fonts/Nunito-Italic-VariableFont_wght.ttf') format('truetype');
  font-weight: 200 1000;
  font-style: italic;
  font-display: swap;
}

:root {
  --red: #d65a5a;
  --red-dk: #b84d4d;
  --yellow: #f7f1e3;
  --yel-lt: #fcfaf5;
  --blue: #576574;
  --blu-lt: #eeeff1;
  --dark: #2f3640;
  --mid: #7f8c8d;
  --light: #f5f6fa;
  --white: #fff;
  --green: #6ab04c;
  --grn-lt: #f1f8ed;
  --shadow: 0 10px 25px rgb(0 0 0 / 8%);
  --radius: 16px;
  --modal-bg: rgb(0 0 0 / 40%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --yellow: #1a1a1a;
    --yel-lt: #252525;
    --dark: #f5f6fa;
    --mid: #a0a0a0;
    --light: #2d2d2d;
    --white: #262626;
    --blu-lt: #3d3d3d;
    --blue: #a4b0be;
    --grn-lt: #1e271a;
    --shadow: 0 10px 30px rgb(0 0 0 / 50%);
  }

  .form-control {
    border-color: #444 !important;
  }

  .form-control:focus {
    background: #333 !important;
  }

  .dynamik-warn {
    background: #433f2a !important;
    border-color: #fab005 !important;
    color: #ffe066 !important;
  }

  .dynamik-crit {
    background: #3d2a2a !important;
    border-color: var(--red) !important;
    color: #ff8787 !important;
  }
}

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

body {
  font-family: Nunito, sans-serif;
  background: var(--yellow);
  background-image: radial-gradient(circle at 15% 50%, rgb(214 90 90 / 6%) 0%, transparent 60%),
    radial-gradient(circle at 85% 20%, rgb(47 54 64 / 4%) 0%, transparent 50%);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px 60px;
  color: var(--dark);
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header {
  background: var(--red);
  padding: 22px 24px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-badge {
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7em;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
}

.card-header h1 {
  color: white;
  font-size: 1.25em;
  font-weight: 900;
  line-height: 1.2;
}

.card-header p {
  color: rgb(255 255 255 / 85%);
  font-size: 0.82em;
  margin-top: 3px;
}

.header-titles {
  flex: 1;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: Nunito, sans-serif;
  font-size: 0.75em;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.3);
}

.header-back {
  color: white;
  text-decoration: none;
  font-size: 0.8em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.1);
  padding: 6px 10px;
  border-radius: 8px;
}

.card-body {
  padding: 28px 24px;
}

.card-footer {
  background: var(--yel-lt);
  border-top: 1px solid rgb(0 0 0 / 4%);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75em;
  color: var(--mid);
}

.footer-link {
  color: var(--dark);
  text-decoration: none;
  font-weight: 700;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--mid);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--dark);
  text-decoration: underline;
}

/* Forms */
.section-title {
  font-size: 1.05em;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 22px;
  text-align: center;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.73em;
  font-weight: 800;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #edf0f2;
  border-radius: 12px;
  font-family: Nunito, sans-serif;
  font-size: 0.95em;
  color: var(--dark);
  background: var(--light);
  transition: 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--red);
  background: var(--white);
  box-shadow: 0 0 0 4px rgb(214 90 90 / 10%);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.pin-group {
  position: relative;
}

.pin-group input {
  font-size: 1.4em;
  letter-spacing: 0.3em;
  text-align: center;
  font-weight: 700;
}

.toggle-pin {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mid);
  font-size: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-family: Nunito, sans-serif;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s;
  font-size: 1em;
}

.btn-primary {
  background: var(--red);
  color: white;
  box-shadow: 0 6px 16px rgb(214 90 90 / 28%);
}

.btn-primary:hover {
  box-shadow: 0 8px 20px rgb(214 90 90 / 38%);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--blu-lt);
  color: var(--blue);
  margin-bottom: 16px;
  font-size: 0.9em;
}

.error-msg {
  color: var(--red);
  font-size: 0.85em;
  font-weight: 700;
  text-align: center;
  min-height: 20px;
  margin-top: 8px;
}

/* Tabs */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--blu-lt);
  background: var(--white);
}

.tab-btn {
  flex: 1;
  padding: 13px 8px;
  border: none;
  background: none;
  font-family: Nunito, sans-serif;
  font-size: 0.82em;
  font-weight: 800;
  color: var(--mid);
  cursor: pointer;
  transition: 0.2s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tab-btn.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

/* Components */
.support-box {
  background: var(--blu-lt);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 14px;
  font-size: 0.85em;
  line-height: 1.6;
  color: var(--dark);
  display: none;
  margin-bottom: 20px;
  white-space: normal;
}

.support-box.open {
  display: block;
}

.support-box ul {
  margin: 10px 0 0 18px;
}

.support-box li {
  margin-bottom: 6px;
}

.dynamik-warn,
.dynamik-crit {
  display: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.85em;
  margin-top: 10px;
  border: 1px solid;
  font-weight: 600;
}

.dynamik-warn {
  background: #fff9db;
  border-color: #fab005;
  color: #856404;
}

.dynamik-crit {
  background: #fff5f5;
  border-color: var(--red);
  color: #a02020;
}

.show {
  display: block !important;
}

.success-card {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  font-size: 3.5em;
  margin-bottom: 14px;
  animation: pop-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pop-in {
  from {
    transform: scale(0.5);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-card h2 {
  color: var(--green);
  margin-bottom: 10px;
}

.success-card p {
  color: var(--mid);
  font-size: 0.9em;
  line-height: 1.5;
  margin-bottom: 20px;
}

.report-card {
  background: var(--light);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--blu-lt);
}

.report-card.dyn-4 {
  border-left-color: #fab005;
}

.report-card.dyn-5 {
  border-left-color: var(--red);
}

.report-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 4px;
}

.report-date {
  font-weight: 800;
  font-size: 0.95em;
}

.report-by {
  font-size: 0.78em;
  color: var(--mid);
}

.report-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 700;
}

.badge-blue {
  background: var(--blu-lt);
  color: var(--blue);
}

.badge-green {
  background: var(--grn-lt);
  color: var(--green);
}

.badge-warn {
  background: #fff9db;
  color: #856404;
}

.badge-crit {
  background: #fff5f5;
  color: #a02020;
}

.report-note {
  font-size: 0.82em;
  color: var(--mid);
  margin-top: 6px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.divider {
  border: none;
  border-top: 1px solid var(--blu-lt);
  margin: 20px 0;
}

.accordion {
  margin-top: 20px;
}

.accordion-item {
  border: 1px solid var(--blu-lt);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  padding: 14px 16px;
  background: var(--yel-lt);
  border: none;
  text-align: left;
  font-family: Nunito, sans-serif;
  font-weight: 700;
  font-size: 0.9em;
  cursor: pointer;
  color: var(--dark);
  transition: 0.2s;
}

.accordion-header:hover {
  background: var(--light);
}

.accordion-content {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--white);
}

.accordion-content.open {
  padding: 14px 16px;
  max-height: 500px;
}

/* Success Overlay */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-bg);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}

.overlay.show {
  display: flex;
  animation: fade-in 0.25s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.overlay-card {
  background: var(--white);
  border-radius: 20px;
  padding: 30px 26px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgb(0 0 0 / 20%);
  animation: pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
}

.overlay-icon {
  font-size: 3.5em;
  margin-bottom: 14px;
}

.overlay-card h2 {
  margin-bottom: 10px;
  font-weight: 900;
  font-size: 1.5em;
}

.overlay-card p {
  color: var(--mid);
  font-size: 0.9em;
  line-height: 1.5;
  margin-bottom: 20px;
}