:root {
  /* Color Palette - Premium Light Theme (Clean & Trustworthy) */
  --primary: #4F46E5;
  /* Indigo 600 */
  --primary-hover: #4338CA;
  /* Indigo 700 */
  --secondary: #10B981;
  /* Emerald 500 */
  --accent: #F59E0B;
  /* Amber 500 */
  --background: #F8FAFC;
  /* Slate 50 */
  --surface: #FFFFFF;
  /* White */
  --surface-alt: #F1F5F9;
  /* Slate 100 */
  --text: #0F172A;
  /* Slate 900 */
  --text-muted: #64748B;
  /* Slate 500 */
  --error: #EF4444;
  /* Red 500 */
  --success: #10B981;
  /* Emerald 500 */
  --border: #E2E8F0;
  /* Slate 200 */
  --radius: 16px;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --glass: rgba(255, 255, 255, 0.8);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--background);
  /* Subtle mesh gradient for advanced feel */
  background-image:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 1rem;
}

.container {
  max-width: 800px;
  width: 100%;
  background: var(--surface);
  padding: 3.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.5);
  /* Slight border for crispness */
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  /* Glassmorphism hint */
}

/* Decorative top line */
.container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.form-header {
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.form-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Highlight "ADC" or parts of title if needed, but simple is clean */

.form-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.form-group {
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.form-group label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.form-group label .required {
  color: var(--error);
  margin-left: 0.25rem;
}

.input-control {
  width: 100%;
  padding: 0.875rem 1.25rem;
  background-color: var(--surface-alt);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  font-family: inherit;
}

.input-control:hover {
  background-color: #E2E8F0;
  /* Slightly darker slate */
}

.input-control:focus {
  background-color: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.input-control::placeholder {
  color: #94A3B8;
  opacity: 0.8;
}

textarea.input-control {
  min-height: 140px;
  resize: vertical;
  line-height: 1.7;
}

/* Grid layout for small fields */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

/* Custom Checkbox/Radio */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.4rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.75rem;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.checkbox-item:hover {
  background-color: var(--surface-alt);
}

.checkbox-item input[type="checkbox"] {
  appearance: none;
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid #CBD5E1;
  border-radius: 6px;
  background-color: var(--surface);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: -2px;
  /* 微調整：視覚的に中心に合わせる */
}

.checkbox-item input[type="checkbox"]:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkbox-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 45%;
  left: 50%;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}

.checkbox-item span {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.4;
}

.checkbox-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  position: relative;
}

.checkbox-item a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -1px;
  left: 0;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.checkbox-item a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}


/* File Upload */
.file-upload-container {
  border: 2px dashed var(--border);
  padding: 3rem;
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background: var(--surface-alt);
}

.file-upload-container:hover {
  border-color: var(--primary);
  background: #EEF2FF;
  /* Very light indigo */
}

.file-upload-container p:first-child {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.preview-container {
  margin-top: 1.5rem;
  text-align: center;
  display: none;
}

.preview-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 12px;
  /* Slightly rounder */
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  width: 100%;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--text);
  /* Dark button for high contrast */
  color: white;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.2);
}

.btn-primary:hover {
  background: #1e293b;
  /* Slightly lighter slate */
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  /* Darker overlay */
  backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-content {
  background: var(--surface);
  padding: 3rem;
  border-radius: 20px;
  max-width: 750px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: var(--text);
}

.modal-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
}

.modal-body h3::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 24px;
  background: var(--primary);
  margin-right: 0.75rem;
  border-radius: 3px;
}


.modal-body p {
  margin-bottom: 1rem;
  color: #475569;
  /* Slate 600 */
  font-size: 1rem;
  line-height: 1.75;
}

.modal-body ul,
.modal-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.modal-body li {
  margin-bottom: 0.5rem;
  color: #475569;
  font-size: 1rem;
}

/* Form Validation Feedback */
.error-message {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Revert display none for JS toggling logic, but keep the style */
.error-message {
  display: none;
  /* Default hidden */
}

.error-message::before {
  content: '⚠️';
  font-size: 0.9em;
}

.input-control.is-invalid {
  border-color: var(--error);
  background-color: #FEF2F2;
  /* Red 50 */
}

.input-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Utilities */
.hidden {
  display: none;
}