/* Basic reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: #f2f2f2;
  padding: 20px;
  color: #222;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

form {
  background: #fff;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

label {
  display: block;
  margin-top: 10px;
  font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  padding: 8px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

input[type="checkbox"] {
  margin-right: 6px;
}

.buttons {
  margin-top: 14px;
  text-align: right;
}

button {
  padding: 8px 12px;
  border: none;
  background: #007bff;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

button[type="reset"] {
  background: #6c757d;
  margin-left: 8px;
}

footer {
  text-align: center;
  margin-top: 14px;
  color: #666;
}

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --accent: #0b5ed7; /* primary blue */
  --accent-2: #6c757d;
  --text: #222;
  --radius: 8px;
  --gap: 12px;
  --max-width: 900px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 18px;
}

.subtitle {
  color: var(--accent-2);
  font-size: 0.95rem;
}

main {
  display: flex;
  justify-content: center;
}

form {
  width: 100%;
  max-width: var(--max-width);
  background: var(--card);
  padding: calc(var(--gap) * 1.2);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(10, 10, 20, 0.06);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

/* Fieldset layout: stack on small screens, use two columns on larger ones */
fieldset {
  border: 1px solid #e2e6ea;
  padding: 12px;
  border-radius: 6px;
}

legend {
  padding: 0 6px;
  font-weight: 600;
  color: var(--accent);
}

label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

/* inline labels used for radio/checkbox small controls */
.inline {
  display: inline-block;
  margin-right: 10px;
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
input[type="file"],
select,
textarea,
input[list] {
  width: 100%;
  padding: 8px;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  background: #fff;
  transition: box-shadow 180ms ease, border-color 180ms ease,
    transform 120ms ease;
}

/* Custom focus state for accessibility */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(11, 94, 215, 0.12);
  transform: translateY(-1px);
}

img.photo {
  display: block;
  margin: 8px 0;
  width: 120px;
  height: auto;
  border-radius: 6px;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

button {
  background: var(--accent);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 160ms ease, transform 80ms ease;
}

button:hover {
  background: #074bb0;
  transform: translateY(-2px);
}

button.secondary {
  background: #6c757d;
}

.req {
  color: #d9534f; /* red for required */
  font-weight: 600;
}

progress {
  width: 100%;
  height: 14px;
  border-radius: 6px;
  overflow: hidden;
  appearance: none;
}

/* Responsive layout: on wide screens, arrange fieldsets in two columns */
@media (min-width: 900px) {
  form {
    grid-template-columns: 1fr 1fr;
  }

  /* Make the last row (actions) span both columns */
  .form-actions {
    grid-column: 1 / -1;
  }
}

/* Small screens tweak */
@media (max-width: 420px) {
  body {
    padding: 12px;
  }

  h1 {
    font-size: 1.2rem;
  }
}

/* End of styles.css */
