/* ウェルカムモーダル */
.welcome-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.welcome-content {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.welcome-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.welcome-logo i {
  font-size: 3rem;
  color: #2d5a27;
}

.welcome-logo h1 {
  font-size: 2.5rem;
  color: #2d5a27;
  margin: 0;
}

.welcome-subtitle {
  font-size: 1.1rem;
  color: #7f8c8d;
  margin-bottom: 2rem;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.feature-item {
  padding: 1rem;
  border-radius: 12px;
  background: #f8fffe;
  border: 1px solid #e8f5e8;
}

.feature-item i {
  font-size: 2rem;
  color: #2d5a27;
  margin-bottom: 0.5rem;
}

.feature-item h3 {
  margin: 0.5rem 0;
  color: #2c3e50;
}

.feature-item p {
  margin: 0;
  font-size: 0.9rem;
  color: #7f8c8d;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: #2d5a27;
  color: white;
}

.btn-primary:hover {
  background: #1e3d1b;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f8f9fa;
  color: #2c3e50;
  border: 1px solid #e9ecef;
}

.btn-secondary:hover {
  background: #e9ecef;
}

.btn-demo {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-demo:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 認証モーダルスタイル */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.auth-modal-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #f1f3f4;
}

.auth-modal-header h2 {
  margin: 0;
  color: #2d5a27;
  font-size: 1.5rem;
  font-weight: 600;
}

.auth-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #7f8c8d;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.auth-close:hover {
  background: #f8f9fa;
  color: #2c3e50;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid #f1f3f4;
}

.auth-tab {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #7f8c8d;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-tab.active {
  color: #2d5a27;
  border-bottom: 2px solid #2d5a27;
  background: #f8fffe;
}

.auth-tab:hover:not(.active) {
  background: #f8f9fa;
  color: #2c3e50;
}

.auth-content {
  padding: 1.5rem;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2d5a27;
  box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.1);
}

.password-input {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #7f8c8d;
  cursor: pointer;
  padding: 4px;
}

.password-toggle:hover {
  color: #2c3e50;
}

.password-strength {
  margin-top: 0.5rem;
}

.strength-bar {
  height: 4px;
  background: #f1f3f4;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.strength-fill {
  height: 100%;
  transition: all 0.3s ease;
}

.strength-text {
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #e9ecef;
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: #2d5a27;
  border-color: #2d5a27;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.forgot-password {
  color: #2d5a27;
  text-decoration: none;
  font-size: 0.9rem;
}

.forgot-password:hover {
  text-decoration: underline;
}

.auth-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.auth-btn.primary {
  background: #2d5a27;
  color: white;
}

.auth-btn.primary:hover {
  background: #1e3d1b;
  transform: translateY(-1px);
}

.auth-btn.secondary {
  background: #f8f9fa;
  color: #2c3e50;
  border: 1px solid #e9ecef;
}

.auth-btn.secondary:hover {
  background: #e9ecef;
}

.auth-btn.demo {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.auth-btn.demo:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.auth-divider {
  text-align: center;
  margin: 1rem 0;
  position: relative;
  color: #7f8c8d;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e9ecef;
}

.auth-divider span {
  background: white;
  padding: 0 1rem;
  position: relative;
}

.sdg-selector-container {
  margin-top: 0.5rem;
}

.sdg-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 8px;
  margin-bottom: 1rem;
}

.sdg-tag {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.sdg-tag:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.sdg-tag.selected {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 0 0 2px #2d5a27;
}

.sdg-questionnaire-btn {
  width: 100%;
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  color: #2c3e50;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sdg-questionnaire-btn:hover {
  background: #e9ecef;
  transform: translateY(-1px);
}

.terms-link,
.privacy-link {
  color: #2d5a27;
  text-decoration: none;
}

.terms-link:hover,
.privacy-link:hover {
  text-decoration: underline;
}

/* SDGs質問モーダル */
.sdg-questionnaire-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.questionnaire-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.questionnaire-header {
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid #f1f3f4;
}

.questionnaire-header h2 {
  margin: 0 0 1rem;
  color: #2d5a27;
}

.questionnaire-header p {
  margin: 0;
  color: #7f8c8d;
}

.questionnaire-body {
  padding: 2rem;
}

.question h3 {
  margin: 0 0 1.5rem;
  color: #2c3e50;
  font-size: 1.2rem;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option-label {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 2px solid #f1f3f4;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.option-label:hover {
  border-color: #2d5a27;
  background: #f8fffe;
}

.option-label input {
  margin-right: 1rem;
}

.option-label input:checked + .option-text {
  color: #2d5a27;
  font-weight: 500;
}

.questionnaire-progress {
  margin: 2rem 0;
}

.progress-bar {
  height: 8px;
  background: #f1f3f4;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: #2d5a27;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.9rem;
  color: #7f8c8d;
  text-align: center;
  display: block;
}

.questionnaire-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.questionnaire-result {
  padding: 2rem;
}

.questionnaire-result h3 {
  margin: 0 0 1.5rem;
  color: #2d5a27;
  text-align: center;
}

.recommended-sdgs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.recommended-sdg {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #f1f3f4;
  border-radius: 8px;
}

.recommended-sdg .sdg-tag {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1rem;
}

.sdg-info h4 {
  margin: 0 0 0.5rem;
  color: #2c3e50;
}

.sdg-info p {
  margin: 0;
  color: #7f8c8d;
  font-size: 0.9rem;
}

.result-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .welcome-content {
    padding: 2rem;
    margin: 5% auto;
    border-radius: 20px;
  }

  .welcome-logo h1 {
    font-size: 2.2rem;
  }

  .welcome-subtitle {
    font-size: 1.1rem;
  }

  .welcome-features {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
  }

  .feature-item {
    padding: 1.25rem;
  }

  .auth-modal-content {
    margin: 5% auto;
    width: 95%;
    border-radius: 16px;
  }

  .auth-modal-header,
  .auth-content,
  .social-auth {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .auth-tabs {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-options {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .sdg-selector {
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    max-height: 120px;
  }

  .sdg-tag {
    width: 40px;
    height: 40px;
    font-size: 0.7rem;
  }

  .auth-btn {
    padding: 14px 20px;
    font-size: 1rem;
  }

  .auth-modal-content {
    width: 95%;
    margin: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .welcome-features {
    grid-template-columns: 1fr;
  }

  .welcome-actions {
    gap: 0.5rem;
  }

  .questionnaire-actions {
    flex-direction: column;
  }

  .result-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .welcome-content {
    padding: 1.5rem;
  }

  .welcome-logo {
    flex-direction: column;
    gap: 0.5rem;
  }

  .welcome-logo h1 {
    font-size: 1.8rem;
  }

  .welcome-logo i {
    font-size: 2.5rem;
  }

  .auth-modal-content {
    width: 98%;
    margin: 2% auto;
  }

  .form-group input,
  .form-group select {
    padding: 12px 14px;
  }
}

/* アクセシビリティ */
.auth-btn:focus,
.auth-close:focus,
.auth-tab:focus,
.form-group input:focus,
.form-group select:focus {
  outline: 2px solid #7fb069;
  outline-offset: 2px;
}

/* 高コントラストモード */
@media (prefers-contrast: high) {
  .auth-modal-content,
  .welcome-content {
    border: 2px solid #374151;
  }

  .form-group input,
  .form-group select {
    border-width: 2px;
  }
}

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
  .auth-modal-content,
  .welcome-content,
  .auth-btn,
  .sdg-tag,
  .password-toggle,
  .checkmark,
  .feature-item {
    transition: none;
    animation: none;
  }

  .auth-btn::before {
    display: none;
  }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  .welcome-content {
    background: rgba(31, 41, 55, 0.95);
    color: #f9fafb;
  }

  .welcome-subtitle,
  .feature-item p {
    color: #d1d5db;
  }

  .feature-item {
    background: rgba(55, 65, 81, 0.6);
    border-color: rgba(75, 85, 99, 0.3);
  }

  .feature-item h3 {
    color: #f9fafb;
  }

  .auth-modal-content {
    background: #1f2937;
    color: #f9fafb;
  }

  .auth-modal-header {
    border-color: #374151;
  }

  .auth-tabs {
    background: #374151;
  }

  .auth-tab {
    color: #d1d5db;
  }

  .auth-tab.active {
    background: #4b5563;
    color: #f9fafb;
  }

  .form-group input,
  .form-group select {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }

  .form-group input:focus,
  .form-group select:focus {
    background: #4b5563;
  }

  .sdg-selector {
    background: #374151;
    border-color: #4b5563;
  }

  .auth-divider span {
    background: #1f2937;
  }

  .questionnaire-content {
    background: #1f2937;
    color: #f9fafb;
  }

  .questionnaire-header {
    border-color: #374151;
  }

  .questionnaire-header h2 {
    color: #f9fafb;
  }

  .questionnaire-header p {
    color: #d1d5db;
  }

  .questionnaire-body {
    color: #f9fafb;
  }

  .question h3 {
    color: #f9fafb;
  }

  .question-options {
    color: #f9fafb;
  }

  .option-label {
    border-color: #4b5563;
    background: #374151;
  }

  .option-label:hover {
    border-color: #f9fafb;
    background: #4b5563;
  }

  .option-label input:checked + .option-text {
    color: #f9fafb;
  }

  .questionnaire-progress .progress-bar {
    background: #4b5563;
  }

  .questionnaire-progress .progress-fill {
    background: #f9fafb;
  }

  .questionnaire-progress .progress-text {
    color: #f9fafb;
  }

  .questionnaire-actions {
    color: #f9fafb;
  }

  .questionnaire-result {
    color: #f9fafb;
  }

  .recommended-sdgs {
    color: #f9fafb;
  }

  .recommended-sdg {
    border-color: #4b5563;
    background: #374151;
  }

  .recommended-sdg .sdg-tag {
    background: #4b5563;
    color: #f9fafb;
  }

  .sdg-info h4 {
    color: #f9fafb;
  }

  .sdg-info p {
    color: #d1d5db;
  }

  .result-actions {
    color: #f9fafb;
  }
}
