:root {
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --accent-green: #39ff14;
  --accent-red: #ff3333;
  --accent-yellow: #ffcc00;
  --border-color: #333333;
  --ecitizen-blue: #0A58CA;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  padding-bottom: 80px; /* space for sticky ad */
}

/* Typography & Accessibility */
h1 { font-size: 26px; font-weight: 800; text-align: center; margin-top: 20px;}
h2 { font-size: 20px; font-weight: 600; margin-bottom: 10px; }
p, label, input, button, textarea { font-size: 16px; }
.subtitle { text-align: center; color: var(--text-secondary); font-size: 14px; margin-bottom: 30px; }
.instruction { margin-bottom: 12px; color: var(--text-secondary); }

.app-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  min-height: 100vh;
}

/* Sections */
section {
  background-color: var(--surface-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.calc-panel.active { display: block; animation: fadeIn 0.3s ease; }

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

/* Inputs */
.input-group {
  margin-bottom: 16px;
}
.input-group label {
  display: block;
  margin-bottom: 8px;
  color: #eeeeee;
  font-weight: 600;
}
input[type="number"], textarea {
  width: 100%;
  padding: 16px;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 18px; /* High legibility */
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-green);
}
textarea {
  min-height: 120px;
  resize: vertical;
  margin-bottom: 12px;
}

/* Buttons */
.action-btn {
  width: 100%;
  padding: 16px;
  background-color: var(--accent-green);
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}
.action-btn:active { transform: scale(0.98); }
.action-btn.secondary { background-color: #333; color: #fff; border: 1px solid #555; }
.action-btn.secondary:hover { background-color: #444; }
.action-btn.text-only { background: transparent; color: var(--text-secondary); margin-top: 10px; font-weight: normal; font-size: 14px; padding: 10px; }
.action-btn.text-only:hover { color: #fff; }

.button-row { display: flex; flex-direction: column; gap: 4px; }

/* Offence Grid */
.offence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.offence-btn {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 16px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.offence-btn:hover { border-color: var(--accent-green); background-color: rgba(57, 255, 20, 0.05); }
.offence-btn.selected {
  background-color: rgba(57, 255, 20, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

/* Ads */
.ad-slot {
  background-color: #222;
  border: 1px dashed #555;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}
.inline-ad {
  width: 100%;
  height: 250px;
  max-width: 300px;
  margin: 30px auto;
  border-radius: 8px;
}
.banner-ad {
  width: 100%;
  height: 100px;
  max-width: 320px;
  margin: 0 auto 24px auto;
  border-radius: 8px;
}
.sticky-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  z-index: 90;
}

/* SEO Content Section */
.seo-content {
  background-color: transparent;
  border: none;
  box-shadow: none;
  padding: 10px 10px 30px;
}
.seo-content h2, .seo-content h3 {
  font-size: 18px;
  color: var(--text-primary);
  margin-top: 20px;
  margin-bottom: 8px;
}
.seo-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.trust-link {
  color: var(--ecitizen-blue);
  text-decoration: underline;
  font-weight: 600;
  display: inline-block;
  margin-top: 5px;
}
.trust-link:hover {
  color: #3b82f6;
}

/* Bottom Sheet / Result Engine */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 85vh;
  background-color: #000;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-top: 2px solid var(--border-color);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.9);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
  z-index: 100;
  padding: 24px;
  overflow-y: auto;
}
@media (min-width: 601px) {
  .bottom-sheet {
    width: 600px;
    left: 50%;
    margin-left: -300px;
  }
}

.bottom-sheet.show {
  transform: translateY(0);
}
.drag-handle {
  width: 40px;
  height: 6px;
  background-color: #444;
  border-radius: 3px;
  margin: 0 auto 20px;
}
.result-content { text-align: center; }
.result-content h2 { margin-bottom: 5px; }

.fine-display { margin: 20px 0; display: flex; align-items: flex-start; justify-content: center; gap: 8px; }
.fine-display .currency { font-size: 24px; font-weight: 600; color: var(--text-secondary); margin-top: 8px; }
.fine-display .amount { font-size: 64px; font-weight: 800; line-height: 1; }

.warning-badge {
  background-color: rgba(255, 204, 0, 0.1);
  color: var(--accent-yellow);
  border: 1px solid var(--accent-yellow);
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  margin: 15px 0 20px;
  text-align: left;
  line-height: 1.4;
}
.warning-badge.error {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background-color: rgba(255, 51, 51, 0.1);
}

.details { margin-bottom: 24px; font-size: 16px; text-align: left; background: var(--surface-color); padding: 16px; border-radius: 8px;}
.details p { margin-bottom: 10px; }
.details p:last-child { margin-bottom: 0; }
.details strong { color: #dddddd; }

.ecitizen-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background-color: var(--ecitizen-blue);
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  border-radius: 8px;
  font-size: 18px;
  margin-bottom: 16px;
  transition: opacity 0.2s;
}
.ecitizen-btn:hover { opacity: 0.9; }

.close-btn {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.close-btn:hover { background: #111; }

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 50px; /* Above sticky ad */
  left: 0;
  width: 100%;
  background-color: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(10px);
  padding: 16px;
  border-top: 1px solid var(--border-color);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 601px) {
  .cookie-banner { width: 600px; left: 50%; margin-left: -300px; border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color); border-top-left-radius: 8px; border-top-right-radius: 8px; }
}

.cookie-banner.hidden { display: none; }
.cookie-banner p { font-size: 14px; color: #ccc; }
.cookie-actions { display: flex; justify-content: space-between; align-items: center; }
.cookie-actions button { background: var(--text-primary); color: #000; border: none; padding: 10px 20px; border-radius: 6px; font-weight: bold; cursor: pointer;}
.cookie-actions a { color: var(--accent-green); font-size: 14px; }

/* Hidden utility */
.hidden { display: none !important; }

/* Status Colors */
.text-green { color: var(--accent-green) !important; }
.text-red { color: var(--accent-red) !important; }
.text-yellow { color: var(--accent-yellow) !important; }

/* Disclaimer */
.disclaimer { font-size: 12px; color: #666; text-align: center; margin-top: 20px; padding: 0 10px; }

/* Responsive Inline Mode for Result Card */
.bottom-sheet.inline-mode {
  position: relative;
  transform: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin: 24px auto 40px auto;
  max-height: none;
  width: 100%;
}
.bottom-sheet.inline-mode .drag-handle {
  display: none;
}
@media (min-width: 601px) {
  .bottom-sheet.inline-mode {
    left: auto;
    margin-left: auto;
  }
}
