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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.header {
  background: linear-gradient(135deg, #2c5aa0 0%, #1e3d72 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
  position: relative;
  width: 100%;
}

.logo-container {
  margin-bottom: 20px;
}

.logo {
  max-width: 250px;
  height: auto;
  margin: 0 auto 15px;
  display: block;
}

.header h1 {
  font-size: 2.2em;
  margin-bottom: 12px;
  font-weight: 600;
}

.header p {
  font-size: 1.1em;
  opacity: 0.95;
  max-width: 500px;
  margin: 0 auto;
}

form {
  padding: 40px 30px;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  margin-bottom: 0;
  min-width: 250px;
}

.form-group.full-width {
  margin-bottom: 25px;
  min-width: 100%;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s ease;
  font-family: inherit;
  background-color: #fafbfc;
  box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2c5aa0;
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
  background-color: white;
}

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

select {
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  padding-right: 45px;
}

.file-upload-wrapper {
  position: relative;
  border: 2px dashed #cbd5e0;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: #f8f9fa;
  transition: all 0.3s ease;
  cursor: pointer;
  width: 100%;
}

.file-upload-wrapper:hover {
  border-color: #2c5aa0;
  background: #f0f4f8;
}

.file-upload-wrapper.dragover {
  border-color: #2c5aa0;
  background: #e6f0ff;
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
}

.file-upload-text {
  pointer-events: none;
}

.file-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 8px;
}

.file-text {
  color: #6c757d;
  font-size: 14px;
}

.submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #2c5aa0 0%, #1e3d72 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(44, 90, 160, 0.3);
}

.submit-btn:active {
  transform: translateY(2px);
  box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s ease-in-out infinite;
  margin-right: 8px;
}

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

.checkbox-group {
  margin: 20px 0;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2px solid #ddd;
  border-radius: 3px;
}

input[type="checkbox"]:checked {
  background-color: #6ba3f5;
  border-color: #6ba3f5;
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }
  .form-group {
    min-width: 100%;
  }
  .container {
    margin: 10px;
    max-width: calc(100% - 20px);
  }
}

/* Center the reCAPTCHA widget */
#recaptchaWidget {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

/* -------- Modal Popup (in-page, not browser alert) -------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.modal.show {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(520px, calc(100% - 32px));
  margin: 12vh auto 0;
  background: #ffffff;
  border-radius: 16px;
  padding: 26px 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  border: 1px solid #e9ecef;
  transform: translateY(10px);
  animation: modalIn 180ms ease-out forwards;
}

@keyframes modalIn {
  to { transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  background: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #334155;
  transition: background 0.2s ease, transform 0.15s ease;
}

.modal-close:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin: 4px auto 12px;
  font-size: 30px;
  font-weight: 800;
}

.modal-title {
  text-align: center;
  font-size: 1.35rem;
  color: #0f172a;
  margin-bottom: 6px;
}

.modal-text {
  text-align: center;
  color: #475569;
  font-size: 0.98rem;
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.modal-btn {
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2c5aa0 0%, #1e3d72 100%);
  box-shadow: 0 10px 24px rgba(44, 90, 160, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(44, 90, 160, 0.28);
}

.modal.success .modal-icon {
  background: rgba(34, 197, 94, 0.14);
  color: #16a34a;
}

.modal.error .modal-icon {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
}
