/* =============================================
   index.css - TOPJAPAN 目次UI スタイル
   テーマ：黒 × ゴールド × ピンクアクセント
============================================= */

/* ----- リセット & 基本 ----- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Hiragino Sans", "Meiryo", sans-serif;
  background: #ffffff;
  min-height: 100vh;
  color: #333333;
  overflow-x: hidden;
}

/* ----- メインコンテナ ----- */
.top-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =============================================
   ヘッダー部：タイトル
============================================= */
.top-header {
  text-align: center;
  margin-bottom: 50px;
}

.main-title {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, #d4af37, #f5e6b3, #d4af37);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 30px rgba(212, 175, 55, 0.3);
  margin-bottom: 8px;
}

.sub-title {
  font-size: 24px;
  font-weight: 400;
  color: #c9a227;
  letter-spacing: 0.2em;
}

/* =============================================
   工場ボタンエリア
============================================= */
.factory-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
}

.factory-grid {
  display: flex;
  flex-wrap: nowrap;          /* 折り返さず横一列 */
  justify-content: center;
  gap: 16px;
  width: 100%;
}

/* ----- 工場ボタン（共通） ----- */
.factory-btn {
  width: 130px;
  height: 90px;
  flex: 1 1 0;          /* 横一列で均等に伸縮（画面に収める） */
  min-width: 0;
  max-width: 130px;     /* 広い画面でも大きくなりすぎない */
  border: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  
  /* デフォルト色（JSで上書き） */
  background: linear-gradient(145deg, #444, #333);
  color: #fff;
  
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.factory-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.factory-btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.5),
    0 0 20px var(--btn-glow, rgba(212, 175, 55, 0.3));
}

.factory-btn:hover::before {
  left: 100%;
}

.factory-btn:active {
  transform: translateY(-1px) scale(1.01);
}

/* ----- 事務ボタン（特別スタイル） ----- */
.factory-btn.office-btn {
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
  border: 2px solid #d4af37;
  color: #f5e6b3;
}

.factory-btn.office-btn::after {
  content: "🔐";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 14px;
}

.factory-btn.office-btn:hover {
  border-color: #f5e6b3;
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.5),
    0 0 25px rgba(212, 175, 55, 0.4);
}

/* =============================================
   下部エリア
============================================= */
.bottom-section {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 30px;
  align-items: center;
  padding: 30px 0;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

/* ----- 左：バックナンバー ----- */
.bottom-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ----- 中央：ロゴ ----- */
.bottom-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-left: 60px;  /* 右に移動 */
}

.company-logo {
  width: 160px;
  height: auto;
  filter: drop-shadow(0 4px 15px rgba(255, 182, 193, 0.3));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.company-logo:hover {
  transform: scale(1.05) rotate(-2deg);
  filter: drop-shadow(0 6px 25px rgba(255, 182, 193, 0.5));
}

/* ----- 右：マスター管理 ----- */
.bottom-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* ----- メニューボタン（共通） ----- */
.menu-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: 1px solid #333;
  border-radius: 12px;
  background: linear-gradient(145deg, #1a1a1a, #222);
  color: #ccc;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
}

.menu-btn:hover {
  border-color: #d4af37;
  color: #f5e6b3;
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.15);
}

.btn-icon {
  font-size: 22px;
}

.btn-text {
  line-height: 1.4;
}

.btn-text small {
  font-size: 11px;
  color: #888;
}

/* ----- マスター管理ボタン ----- */
.master-btn {
  border-color: #444;
}

.master-btn:hover {
  border-color: #d4af37;
  background: linear-gradient(145deg, #222, #2a2a2a);
}

/* =============================================
   モーダル共通
============================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: linear-gradient(145deg, #1a1a1a, #222);
  border: 2px solid #d4af37;
  border-radius: 20px;
  padding: 36px 40px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(212, 175, 55, 0.1);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #f5e6b3;
}

.modal-title {
  font-size: 22px;
  color: #f5e6b3;
  margin-bottom: 6px;
  text-align: center;
}

.modal-desc {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin-bottom: 24px;
}

/* ----- フォーム ----- */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #d4af37;
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #444;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: 15px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #d4af37;
}

.form-group input::placeholder {
  color: #555;
}

/* ----- ボタン ----- */
.modal-actions {
  margin-top: 24px;
}

.login-btn,
.register-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.login-btn {
  background: linear-gradient(135deg, #d4af37, #f5e6b3);
  color: #111;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.register-btn {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff;
}

.register-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

/* ----- エラーメッセージ ----- */
.modal-error {
  margin-top: 14px;
  font-size: 13px;
  color: #e74c3c;
  text-align: center;
  min-height: 20px;
}

/* =============================================
   レスポンシブ
============================================= */
@media (max-width: 768px) {
  .main-title {
    font-size: 40px;
  }
  
  .sub-title {
    font-size: 18px;
  }
  
  .factory-btn {
    height: 75px;
    max-width: 100px;
    font-size: 15px;
  }
  
  .bottom-section {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }
  
  .bottom-left,
  .bottom-right {
    align-items: center;
  }
  
  .company-logo {
    width: 120px;
  }
}

@media (max-width: 480px) {
  .top-container {
    padding: 24px 16px;
  }
  
  .main-title {
    font-size: 32px;
  }
  
  .factory-grid {
    gap: 6px;
  }
  
  .factory-btn {
    height: 60px;
    max-width: 90px;
    font-size: 12px;
    border-radius: 12px;
  }
}