/**
 * Download Form Modal Styles
 * 資料ダウンロード用モーダルフォーム
 */

/* Modal Container */
.download-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.download-modal.is-open {
  visibility: visible;
  opacity: 1;
}

/* Backdrop */
.download-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* Container */
.download-modal__container {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s ease;
}

.download-modal.is-open .download-modal__container {
  transform: scale(1) translateY(0);
}

/* Content */
.download-modal__content {
  padding: 2rem;
}

/* Close Button */
.download-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: #6b7280;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.download-modal__close:hover {
  background: #f3f4f6;
  color: #111827;
}

.download-modal__close:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Header */
.download-modal__header {
  margin-bottom: 1.5rem;
  padding-right: 2rem;
}

.download-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.download-modal__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  word-break: break-word;
}

/* Form */
.download-modal__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Field */
.download-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.download-modal__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.download-modal__required {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
  background: #dc2626;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.download-modal__optional {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 9999px;
}

.download-modal__input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #111827;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.download-modal__input::placeholder {
  color: #9ca3af;
}

.download-modal__input:hover {
  border-color: #9ca3af;
}

.download-modal__input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.download-modal__input:invalid:not(:placeholder-shown) {
  border-color: #dc2626;
}

/* Error */
.download-modal__error {
  min-height: 1.25rem;
  font-size: 0.875rem;
  color: #dc2626;
  line-height: 1.4;
}

.download-modal__error:empty {
  display: none;
}

/* Actions */
.download-modal__actions {
  margin-top: 0.5rem;
}

.download-modal__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.download-modal__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.download-modal__submit:active {
  transform: translateY(0);
}

.download-modal__submit:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.download-modal__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.download-modal__submit-icon {
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 480px) {
  .download-modal {
    padding: 0;
    align-items: flex-end;
  }

  .download-modal__container {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
  }

  .download-modal__content {
    padding: 1.5rem;
  }

  .download-modal__title {
    font-size: 1.25rem;
  }
}
