/* === BASE LAYOUT === */
body {
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  color: #222;
  margin: 0;
  padding: 0;
  margin-left: 1vw;
}

h1, h2 {
  color: #333;
  margin-bottom: 32px;
}

.container {
  max-width: 900px;
  width: 100%;
  padding: 24px;
  margin: 0 auto;
  text-align: center;
}

/* === FORM LAYOUT === */
.form-grid-3,
.form-grid-5 {
  display: inline-block;
  vertical-align: top;
  margin-right: 1vw;
}

.form-grid-3 {
  width: 30vw;
}

.form-grid-5 {
  width: 18vw;
}

fieldset {
  padding: 1em;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 1em;
}

/* === INPUTS & SELECTS === */
select.dropdown {
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 32px;
  font-size: 14px;
  margin-top: 5px;
  box-sizing: border-box;
  transition: border-color 0.3s, box-shadow 0.3s;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 6'%3E%3Cpath fill='none' stroke='%23222' stroke-width='1.5' d='M1 1l3 3 3-3'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 8px;
  appearance: none;
  padding-right: 30px;
}

input[type="text"],
input[type="number"],
select,
textarea {
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 32px;
  font-size: 14px;
  margin-top: 5px;
  box-sizing: border-box;
  transition: border-color 0.3s, box-shadow 0.3s;
  background-color: white;
  width: 90%;
  max-width: 350px;
}

textarea {
  min-height: 60px;
  resize: vertical;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: #1976D2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
  outline: none;
}

input:required:invalid,
select:required:invalid {
  border-color: orange;
}

input.required-empty:focus,
select.required-empty:focus {
  border-color: orange !important;
  background-color: #fff3e0 !important;
}

/* === BUTTONS === */
.button {
  background-color: #1976D2;
  color: white;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 34px;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 5px 0;
}

.button:hover {
  background-color: #1565C0;
}

.button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.3);
}

.button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  color: #666;
}

/* === INFO ICONS & TOOLTIPS === */
.info-icon {
  display: inline-block;
  cursor: pointer;
  color: #007bff;
  position: relative;
  font-size: 20px;
}

.info-icon:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.tooltip-text {
  position: absolute;
  top: 50%;
  left: 105%; /* place it to the right of the element */
  transform: translateY(-50%);
  visibility: hidden;
  width: 200px;
  background-color: #333;
  color: #fff;
  text-align: left;
  border-radius: 4px;
  padding: 8px;
  z-index: 1;
  font-size: 12px;
}

/* === UNIQUE STRUCTURES === */
/* Spinner for download page */
.spinner {
  border: 4px solid rgba(255,255,255,0.3);
  border-top: 4px solid #1976D2;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  display: none;
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

/* Responsive tweaks */
@media (max-width: 900px) {
  .form-grid-3, .form-grid-5 { width: 95vw; display: block; }
  .container { padding: 8px; }
  input[type="text"], input[type="number"], select, textarea { max-width: 100%; }
}