/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #212529;
  background: #f5f7fa;
}

main { max-width: 760px; margin: 0 auto; padding: 24px 20px 60px; }

/* === Header === */
.site-header {
  background: #1a3a5c;
  color: #fff;
  padding: 20px 24px;
  text-align: center;
}
.site-header h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: 0.02em; }
.site-header .subtitle { font-size: 0.85rem; opacity: 0.8; margin-top: 4px; }

/* === Footer === */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: #6c757d;
  border-top: 1px solid #dee2e6;
  margin-top: 40px;
}

/* === Form Styles === */
.form-intro {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.form-intro h2 { font-size: 1.1rem; margin-bottom: 6px; color: #1a3a5c; }
.form-intro p { color: #6c757d; font-size: 0.9rem; }

.form-section {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 20px;
}

.form-section h3 {
  font-size: 1rem;
  color: #1a3a5c;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9ecef;
}

.field-group { margin-bottom: 18px; }
.field-group:last-child { margin-bottom: 0; }

.field-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: #343a40;
}

.field-group input[type="text"],
.field-group input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: border-color 0.15s ease;
}
.field-group input:focus {
  outline: none;
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.15);
}

.field-group .required-star { color: #dc3545; margin-left: 2px; }

.field-error {
  color: #dc3545;
  font-size: 0.82rem;
  margin-top: 4px;
}

.field-group.has-error input {
  border-color: #dc3545;
}

/* === Radio Group === */
.radio-group { margin-bottom: 20px; }
.radio-group:last-child { margin-bottom: 0; }

.radio-group-label {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 8px;
  color: #343a40;
}
.radio-group-label .required-star { color: #dc3545; }

.legal-text-box {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  line-height: 1.55;
  background: #f8f9fa;
  white-space: pre-wrap;
  color: #495057;
}

.radio-option {
  display: block;
  padding: 8px 0;
  font-size: 0.9rem;
  cursor: pointer;
}
.radio-option input[type="radio"] { margin-right: 8px; accent-color: #1a3a5c; }

.other-text-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-top: 6px;
}
.other-text-input:focus {
  outline: none;
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.15);
}

/* === Checkbox === */
.checkbox-group { margin-top: 8px; }
.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.checkbox-option input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: #1a3a5c;
  flex-shrink: 0;
}

/* === Submit Button === */
.form-actions {
  text-align: center;
  margin-top: 8px;
}

.btn-submit {
  background: #1a3a5c;
  color: #fff;
  border: none;
  padding: 14px 48px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-submit:hover { background: #152e4a; }
.btn-submit:disabled { background: #6c757d; cursor: not-allowed; }

/* === Confirmation Page === */
.confirmation-box {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 40px 24px;
  text-align: center;
}
.confirmation-box .check-icon {
  width: 64px;
  height: 64px;
  background: #28a745;
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 16px;
}
.confirmation-box h2 { font-size: 1.25rem; color: #1a3a5c; margin-bottom: 8px; }
.confirmation-box p { color: #6c757d; margin-bottom: 20px; }
.confirmation-box a { color: #1a3a5c; font-weight: 600; }

/* === Admin Styles === */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-header h2 { font-size: 1.15rem; color: #1a3a5c; }

.btn-sm {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
}
.btn-outline {
  background: #fff;
  color: #1a3a5c;
  border: 1px solid #1a3a5c;
}
.btn-outline:hover { background: #f0f4f8; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; }

.login-card {
  max-width: 400px;
  margin: 60px auto;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 32px 24px;
}
.login-card h2 { text-align: center; margin-bottom: 20px; color: #1a3a5c; }
.login-card .btn-submit { width: 100%; }
.login-error { color: #dc3545; text-align: center; margin-bottom: 12px; font-size: 0.9rem; }

.submissions-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
}
.submissions-table th,
.submissions-table td {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.88rem;
  border-bottom: 1px solid #e9ecef;
}
.submissions-table th { background: #f8f9fa; font-weight: 600; color: #495057; }
.submissions-table tr:hover td { background: #f8f9fa; }
.submissions-table a { color: #1a3a5c; font-weight: 600; text-decoration: none; }
.submissions-table a:hover { text-decoration: underline; }

.pagination { margin-top: 16px; text-align: center; font-size: 0.88rem; color: #6c757d; }
.pagination a { color: #1a3a5c; margin: 0 8px; font-weight: 600; }

.detail-section { margin-bottom: 18px; }
.detail-section h4 {
  font-size: 0.9rem;
  color: #1a3a5c;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e9ecef;
}
.detail-value { font-size: 0.92rem; color: #343a40; }
.detail-value.other { color: #6c757d; font-style: italic; }

.detail-box {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 20px;
}

.empty-state { text-align: center; padding: 40px; color: #6c757d; }

.alert-info {
  background: #e7f3ff;
  border: 1px solid #b6d4fe;
  color: #0c5460;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 0.88rem;
  margin-bottom: 20px;
}

/* === Embedded / Iframe Mode === */
.embedded-form { max-width: 760px; margin: 0 auto; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.6; color: #212529; }
.embedded-form .form-section { background: #fff; border: 1px solid #dee2e6; border-radius: 6px; padding: 24px; margin-bottom: 20px; }
.embedded-form .form-intro { background: #fff; border: 1px solid #dee2e6; border-radius: 6px; padding: 20px 24px; margin-bottom: 24px; }
.embedded-form .form-actions { text-align: center; margin-top: 8px; }

/* === Landing Page Cards === */
.form-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-card { background: #fff; border: 1px solid #dee2e6; border-radius: 6px; padding: 32px 24px; text-align: center; transition: box-shadow 0.15s ease, transform 0.15s ease; text-decoration: none; display: block; }
.form-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-2px); }
.form-card .card-icon { font-size: 2.5rem; margin-bottom: 12px; }
.form-card h3 { color: #1a3a5c; margin-bottom: 8px; }
.form-card p { font-size: 0.88rem; color: #6c757d; }

@media (max-width: 600px) {
  .form-cards { grid-template-columns: 1fr; }
}

/* === Responsive === */
@media (max-width: 600px) {
  main { padding: 16px 12px 40px; }
  .form-section { padding: 16px; }
  .btn-submit { width: 100%; padding: 14px 24px; }
  .submissions-table { font-size: 0.78rem; }
  .submissions-table th,
  .submissions-table td { padding: 8px 6px; }
  .admin-header { flex-direction: column; align-items: flex-start; }
}
/* Embedded form fixes for osTicket iframe */
.embedded-form {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.embedded-form * {
  box-sizing: border-box;
  max-width: 100%;
}

.embedded-form label,
.embedded-form p,
.embedded-form div {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.embedded-form input[type="text"],
.embedded-form input[type="email"],
.embedded-form textarea,
.embedded-form select {
  width: 100%;
  max-width: 100%;
}