:root {
  --primary: #2563eb; /* blue */
  --primary-dark: #1e40af;
  --bg: #f3f4f6;
  --card-bg: #ffffff;
  --success: #16a34a;
  --error: #dc2626;
}

body {
  font-family: "Inter", Arial, sans-serif;
  background: var(--bg);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 2rem 1rem 1rem 1rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  width: 100%;
  box-sizing: border-box;
}

header h1 {
  font-size: 2rem;
  margin: 0;
  line-height: 1.2;
}

header p {
  margin-top: 0.5rem;
  font-size: 1.1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

main {
  background: var(--card-bg);
  max-width: 500px;
  width: 90%;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-top: -2rem; /* overlap effect */
  box-sizing: border-box;
}

h2 {
  text-align: center;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

label {
  display: block;
  margin-top: 1rem;
  font-weight: 500;
  color: #374151;
}

input {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  box-sizing: border-box;
}

select {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  box-sizing: border-box;
}

button {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.9rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: background 0.2s ease;
}
button:hover {
  background: var(--primary-dark);
}

#loading {
  display: none;
  color: #2563eb;
  font-weight: bold;
  margin-top: 1rem;
}

#result {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg);
  border-radius: 0.75rem;
  display: none;
  box-sizing: border-box;
}

#result h3 {
  margin-top: 0;
  color: var(--primary-dark);
  font-size: 1.3rem;
}

#result p {
  margin: 0.5rem 0;
  font-size: 1rem;
  color: #374151;
}

.violation {
  color: var(--error);
  font-weight: 600;
}

.ok {
  color: var(--success);
  font-weight: 600;
}

#loadingIcon {
  display: inline-block;
  animation: spin 1s linear infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 📱 Mobile responsiveness */
@media (max-width: 480px) {
  header {
    padding: 1.2rem 0.8rem;
  }
  header h1 {
    font-size: 1.4rem;
  }
  header p {
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 0 0.5rem;
  }
  .container {
    width: 95%;
    padding: 1rem;
    margin-top: -1rem;
    border-radius: 0.75rem;
  }
  h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  label {
    margin-top: 0.75rem;
    font-size: 0.9rem;
  }
  input {
    padding: 0.65rem;
    font-size: 0.95rem;
  }
  button {
    padding: 0.85rem;
    font-size: 1rem;
    border-radius: 0.6rem;
  }
  #result {
    padding: 1rem;
  }
  #result h3 {
    font-size: 1.05rem;
  }
  #result p {
    font-size: 0.9rem;
  }
}
