/* Variables */
:root {
  --bg: #f5f5f0;
  --surface: #fff;
  --text: #1a1a1a;
  --text-muted: #555;
  --primary: #0066b3;
  --primary-hover: #004d8c;
  --border: #ddd;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.wrapper {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--primary);
}

.subtitle {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.source {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
}

.source a {
  color: var(--primary);
  text-decoration: none;
}

.source a:hover {
  text-decoration: underline;
}

/* Main */
.main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.fieldset {
  border: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.fieldset legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding: 0;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.radio-label input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.input-group {
  margin-bottom: 1.25rem;
}

.input-group:last-of-type {
  margin-bottom: 0;
}

.input-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.hint {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.input-group input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 102, 179, 0.2);
}

.hidden {
  display: none !important;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
}

/* Resultat */
.resultat {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.resultat h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
}

.resultat .montant-csm {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.resultat .message {
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.resultat .message.exonere {
  background: #e8f5e9;
  color: #1b5e20;
}

.resultat .message.redevable {
  background: #e3f2fd;
  color: #0d47a1;
}

.resultat .message.hors-plage {
  background: #fff3e0;
  color: #e65100;
}

.resultat ul.detail {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.resultat ul.detail li {
  padding: 0.2rem 0;
}

/* Info */
.info {
  background: var(--surface);
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.info h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.info ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.info li {
  margin-bottom: 0.5rem;
}

.info li:last-child {
  margin-bottom: 0;
}

/* Footer */
.footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (min-width: 480px) {
  .header h1 {
    font-size: 2rem;
  }
}
