:root {
  --clr-primary: #00557f;
  --clr-bg: #f7f9fa;
  --clr-white: #ffffff;
  --clr-border: #d1d5da;
  --clr-text: #2e3a45;
  --radius: 6px;
  --gap: 1.5rem;
  --font-stack: 'Cairo', sans-serif;
}

body {
  margin: 0;
  padding: 1.5rem;
  background: var(--clr-bg);
  font-family: var(--font-stack);
  color: var(--clr-text);
  line-height: 1.6;
}

.form-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--clr-white);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.form-container h2 {
  text-align: center;
  color: var(--clr-primary);
  margin: 0 0 2rem 0;
  padding: 0;
}

/* ----------------------------------------------------------------
   Form groups: consistent spacing
-----------------------------------------------------------------*/
.form-group {
  margin-bottom: var(--gap);
  padding: 0;
}

.form-group:last-of-type {
  margin-bottom: 2rem;
}

/* Labels */
.form-group label {
  display: block;
  margin: 0 0 0.5rem 0;
  padding: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.qualification {
  margin: 0;
  padding: 0;
}

/* Textual inputs, selects, textareas */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  margin: 0;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  background: var(--clr-white);
  transition: border-color 0.25s, box-shadow 0.25s;
  box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(0,85,127,0.15);
}

/* Disable resize on textareas */
textarea {
  resize: vertical;
  min-height: 120px;
}

/* Select dropdown styling */
select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  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: left 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-left: 2.5rem;
}

/* ----------------------------------------------------------------
   Radio & checkbox groups (now converted to dropdowns)
-----------------------------------------------------------------*/
.radio-group,
.checkbox-group {
  display: block;
  margin: 0;
  padding: 0;
}

.radio-group select,
.checkbox-group select {
  width: 100% !important;
  padding: 0.75rem 1rem;
  margin: 0 !important;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  background: var(--clr-white);
  transition: border-color 0.25s, box-shadow 0.25s;
  box-sizing: border-box;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  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: left 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-left: 2.5rem;
}

.radio-group select:focus,
.checkbox-group select:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(0,85,127,0.15);
}

/* ----------------------------------------------------------------
   File input — modern styling
-----------------------------------------------------------------*/
input[type="file"] {
  width: 100%;
  font-size: 1rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 0.5rem;
  margin: 0;
  background: var(--clr-white);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  padding: 0.6rem 1.2rem;
  margin-right: 1rem;
  border: none;
  border-radius: calc(var(--radius) - 1px);
  background: var(--clr-primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.25s;
  font-family: inherit;
}

input[type="file"]::file-selector-button:hover {
  background: #004766;
}

/* Show filename text */
.file-name {
  display: block;
  margin: 0.5rem 0 0 0;
  padding: 0;
  font-size: 0.9rem;
  color: #666;
}

/* ----------------------------------------------------------------
   Submit button
-----------------------------------------------------------------*/
button[type="submit"] {
  width: 100%;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0 0 0;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 600;
  background: var(--clr-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.3s, transform 0.1s;
}

button[type="submit"]:hover {
  background: #004766;
  transform: translateY(-1px);
}

button[type="submit"]:active {
  transform: translateY(0);
}

/* ----------------------------------------------------------------
   Required asterisk
-----------------------------------------------------------------*/
label.required::after {
  content: "*";
  color: #e53e3e;
  margin-left: 0.25rem;
  font-weight: bold;
}

/* ----------------------------------------------------------------
   Override inline styles and fix conflicts
-----------------------------------------------------------------*/
.form-group {
  margin-bottom: var(--gap);
  padding: 0 !important;
}

/* Textual inputs, selects, textareas - override width calc */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100% !important;
  padding: 0.75rem 1rem;
  margin: 0 !important;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  background: var(--clr-white);
  transition: border-color 0.25s, box-shadow 0.25s;
  box-sizing: border-box;
}
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }
  
  .form-container {
    padding: 1.5rem;
  }
  
  .radio-group,
  .checkbox-group {
    gap: 1rem;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }
  
  .form-container {
    padding: 1rem;
  }
  
  :root {
    --gap: 1rem;
  }
}