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

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f8fafc;
  color: #334155;
  line-height: 1.6;
}

body {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  min-height: 100vh;
}

form {
  padding: 2rem;
  max-width: 500px;
  margin: 2rem auto;
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

.form-title {
  margin-bottom: 1.5rem;
  color: #1e293b;
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
}

button,
input,
select {
  font-size: 1rem;
  margin: 0 0 1.5rem;
  font-family: inherit;
}

label {
  text-transform: uppercase;
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: #475569;
  letter-spacing: 0.025em;
  margin-bottom: 0.5rem;
}

input[type="radio"] + label {
  display: inline-block;
  text-transform: initial;
  font-weight: 500;
  padding: 0.5rem 1rem;
  margin: 0 0.5rem 0.5rem 0;
  background-color: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #64748b;
  font-size: 0.875rem;
}

input[type="radio"]:checked + label {
  background-color: #3b82f6;
  color: white;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

input[type="radio"] {
  display: none;
}

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  background-color: white !important;
  -webkit-box-shadow: 0 0 0 30px white inset !important;
}

input[type="text"],
input[type="number"],
select {
  display: block;
  width: 100%;
  height: 3rem;
  border: 2px solid #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  font-size: 1rem;
  line-height: 1.5;
  color: #334155;
  background-color: #fff;
  background-clip: padding-box;
  transition: all 0.2s ease;
  font-weight: 500;
}

input[type="text"]:hover,
input[type="number"]:hover,
select:hover {
  border-color: #cbd5e1;
}

button {
  border: 2px solid transparent;
  background-color: transparent;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  outline: none;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-right: 0.75rem;
}

button[type="reset"] {
  background-color: #ef4444;
  color: white;
  border-color: #ef4444;
}

button[type="reset"]:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

button[type="submit"] {
  background-color: #10b981;
  color: white;
  border-color: #10b981;
}

button[type="submit"]:hover {
  background-color: #059669;
  border-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

input:focus,
select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input:focus + span::before,
select:focus + span::before {
  content: '▶';
  position: absolute;
  left: -0.5rem;
  transform: translateY(-3.5rem);
  color: #3b82f6;
  font-size: 1.25rem;
}

.radio-group:focus-within::after {
  content: '▶';
  position: absolute;
  left: -0.5rem;
  transform: translateY(0.25rem);
  color: #3b82f6;  
  font-size: 1.25rem;
}

.radio-group {
  margin-bottom: 1.5rem;
}

#results,
#m-results {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 12px;
  border: 2px solid #bae6fd;
  text-align: center;
}

#results h3,
#m-results h3 {
  color: #0c4a6e;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
}

#article {
  padding: 3% 10%;
  background: white;
  margin: 2rem auto;
  max-width: 800px;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

#article p {
  margin-bottom: 1.5rem;
  color: #475569;
  line-height: 1.7;
}

#article strong {
  color: #1e293b;
  font-weight: 700;
}

#article ul,
#article ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: #475569;
}

#article li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
  margin: 2rem 0;
}

/* Placeholder styling */
input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

/* Select arrow styling */
select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  appearance: none;
}

/* Responsive design */
@media (max-width: 640px) {
  form {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  #article {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }
  
  button {
    width: 100%;
    margin-right: 0;
    margin-bottom: 0.75rem;
  }
}