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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

/* ログイン画面 */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 450px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-container h1 {
  text-align: center;
  color: #333;
  margin-bottom: 10px;
  font-size: 2rem;
}

.login-subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
  font-size: 1rem;
}

.login-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid #eee;
}

.tab-button {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

.tab-button:hover {
  color: #667eea;
}

.tab-button.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.auth-form {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
  font-size: 0.95rem;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.btn-login {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 10px;
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-message {
  color: #f44336;
  font-size: 0.9rem;
  margin-top: 10px;
  min-height: 20px;
  text-align: center;
}

/* ヘッダー */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  color: white;
}

.user-info span {
  font-size: 1rem;
}

.btn-logout {
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-logout:hover {
  background: white;
  color: #667eea;
}

.app {
  min-height: 100vh;
  padding: 20px;
}

.app-header {
  color: white;
  margin-bottom: 40px;
}

.app-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
}

.loading {
  text-align: center;
  padding: 40px;
  color: white;
  font-size: 1.2rem;
}

/* 年度選択 */
.fiscal-year-selector {
  background: white;
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.fiscal-year-label {
  display: block;
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
}

.fiscal-year-select {
  width: 100%;
  max-width: 400px;
  padding: 15px 20px;
  font-size: 1.1rem;
  font-weight: bold;
  border: 3px solid #667eea;
  border-radius: 10px;
  background: white;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px;
  padding-right: 45px;
}

.fiscal-year-select:hover {
  border-color: #764ba2;
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.fiscal-year-select:focus {
  outline: none;
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.fiscal-year-period {
  margin-top: 15px;
  font-size: 1rem;
  color: #666;
  font-weight: 500;
}

/* 目標セクション */
.goal-section {
  background: white;
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.goal-section h2 {
  color: #333;
  margin-bottom: 25px;
  font-size: 1.8rem;
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
}

.input-group {
  margin-bottom: 30px;
}

.input-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: #555;
  font-size: 1.1rem;
}

.input-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s;
}

.input-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-save {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
}

.btn-save:hover {
  background: #45a049;
}

.btn-evaluate {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-evaluate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-evaluate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-large {
  padding: 15px 30px;
  font-size: 1.1rem;
}

.btn-print {
  background: #2196F3;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  margin-right: 15px;
  transition: background 0.3s;
}

.btn-print:hover {
  background: #1976D2;
}

/* AI評価カード */
.ai-evaluation-card {
  margin-top: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  padding: 25px;
  border-left: 5px solid #667eea;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-title {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-badge {
  display: inline-block;
  background: white;
  padding: 8px 16px;
  border-radius: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.score-label {
  font-weight: bold;
  color: #666;
  margin-right: 8px;
}

.score-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: #667eea;
}

.evaluation-section {
  margin-bottom: 20px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.evaluation-section h4 {
  color: #333;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.evaluation-text {
  color: #555;
  line-height: 1.8;
  margin: 0;
}

.evaluation-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.evaluation-section ul li {
  padding: 10px 0;
  padding-left: 25px;
  position: relative;
  color: #555;
  line-height: 1.6;
  border-bottom: 1px solid #eee;
}

.evaluation-section ul li:last-child {
  border-bottom: none;
}

.evaluation-section ul li::before {
  content: '•';
  position: absolute;
  left: 10px;
  color: #667eea;
  font-weight: bold;
  font-size: 1.2rem;
}

.evaluation-section.positive {
  border-left: 4px solid #4CAF50;
}

.evaluation-section.improvement {
  border-left: 4px solid #ff9800;
}

.evaluation-section.warning {
  border-left: 4px solid #f44336;
}

.evaluation-section.challenge {
  border-left: 4px solid #9c27b0;
}

.evaluation-section.suggested {
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  border-left: 4px solid #f39c12;
}

.suggested-goal-text {
  font-weight: bold;
  color: #333;
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
}

/* 総括セクション */
.summary-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.summary-intro {
  text-align: center;
  margin-bottom: 30px;
}

.summary-intro p {
  margin-bottom: 20px;
  color: #555;
  font-size: 1.1rem;
}

.summary-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.summary-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.summary-card.highlight {
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  border: 2px solid #f39c12;
}

.summary-card h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.summary-card ul {
  list-style: none;
  padding: 0;
}

.summary-card ul li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  color: #555;
}

.summary-card ul li:last-child {
  border-bottom: none;
}

.summary-card p {
  color: #555;
  line-height: 1.6;
}

.suggested-goal {
  font-weight: bold;
  color: #333;
  font-size: 1.1rem;
  line-height: 1.8;
  background: rgba(255, 255, 255, 0.5);
  padding: 15px;
  border-radius: 8px;
}


/* 印刷用スタイル */
@media print {
  /* 印刷時に非表示にする要素 */
  header,
  .fiscal-year-selector,
  .button-group,
  .summary-intro,
  .btn-print,
  .btn-logout,
  .btn-save,
  .btn-evaluate,
  .login-screen,
  #loading {
    display: none !important;
  }

  /* 印刷時のレイアウト - コンパクト化 */
  * {
    box-sizing: border-box;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 0.75rem !important;
    line-height: 1.4 !important;
  }

  .app-container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .goal-section {
    margin-bottom: 12px !important;
    padding: 8px !important;
    border: 1px solid #ccc !important;
    background: white !important;
    page-break-inside: avoid;
  }

  .goal-section h2 {
    font-size: 1rem !important;
    margin: 0 0 8px 0 !important;
    padding: 0 0 4px 0 !important;
    border-bottom: 1px solid #333 !important;
    page-break-after: avoid;
  }

  /* 入力欄のスタイル */
  .input-group {
    margin-bottom: 8px !important;
  }

  .input-group label {
    font-weight: bold !important;
    font-size: 0.75rem !important;
    margin: 0 0 2px 0 !important;
    display: block !important;
  }

  textarea {
    border: 1px solid #ccc !important;
    padding: 4px !important;
    background: #f9f9f9 !important;
    width: 100% !important;
    font-size: 0.7rem !important;
    line-height: 1.3 !important;
    margin: 0 !important;
  }

  /* AI評価カードのスタイル */
  .ai-evaluation-card {
    background: white !important;
    border: 1px solid #ccc !important;
    border-radius: 2px !important;
    padding: 8px !important;
    margin: 8px 0 !important;
    box-shadow: none !important;
  }

  .card-title {
    font-size: 0.85rem !important;
    margin: 0 0 6px 0 !important;
    padding: 0 0 4px 0 !important;
    border-bottom: 1px solid #333 !important;
    page-break-after: avoid;
  }

  .score-badge {
    border: 1px solid #333 !important;
    padding: 2px 6px !important;
    margin: 0 8px 6px 0 !important;
    display: inline-block !important;
    font-size: 0.7rem !important;
  }

  .score-label,
  .score-value {
    font-size: 0.7rem !important;
  }

  .evaluation-section {
    margin-bottom: 6px !important;
    padding: 6px !important;
    border: 1px solid #ddd !important;
    background: #f9f9f9 !important;
  }

  .evaluation-section h4 {
    font-size: 0.75rem !important;
    margin: 0 0 4px 0 !important;
    padding: 0 0 2px 0 !important;
    border-bottom: 1px solid #ccc !important;
    page-break-after: avoid;
  }

  .evaluation-text {
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
    margin: 0 !important;
  }

  .evaluation-section ul {
    margin: 0 !important;
    padding-left: 16px !important;
  }

  .evaluation-section ul li {
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
    margin-bottom: 2px !important;
    padding: 2px 0 !important;
  }

  .suggested-goal-text {
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
    padding: 6px !important;
    margin: 0 !important;
  }

  /* 総括セクションのスタイル */
  .summary-section {
    background: white !important;
    page-break-before: auto !important;
  }

  .summary-content {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  .summary-card {
    background: white !important;
    border: 1px solid #ccc !important;
    border-radius: 2px !important;
    padding: 6px !important;
    margin: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .summary-card.highlight {
    background: #fff9e6 !important;
    border: 1px solid #333 !important;
  }

  .summary-card h3 {
    font-size: 0.8rem !important;
    margin: 0 0 4px 0 !important;
    padding: 0 0 2px 0 !important;
    border-bottom: 1px solid #333 !important;
    page-break-after: avoid;
  }

  .summary-card p {
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
    margin: 0 !important;
  }

  .summary-card ul {
    list-style: disc !important;
    padding-left: 16px !important;
    margin: 0 !important;
  }

  .summary-card ul li {
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
    margin-bottom: 2px !important;
    padding: 0 !important;
    border-bottom: none !important;
  }

  .suggested-goal {
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
    padding: 4px !important;
    margin: 0 !important;
  }

  /* ページネーション */
  @page {
    margin: 1cm !important;
    size: A4;
  }

  h2, h3 {
    page-break-after: avoid;
  }

  /* 不要な改ページを防止 */
  .goal-section:last-child {
    page-break-after: auto;
  }
}
