/* デザインのベース */
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background-color: #f4f7f9;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
}

.login-container {
  background: #ffffff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 800px;
}

h2 {
  margin-bottom: 24px;
  color: #333;
  text-align: center;
  font-size: 1.5rem;
}

.field-group {
  margin-top: 20px;
  position: relative;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #555;
}

input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e4e8;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 1rem;
  transition: border-color 0.3s;
}

input[type="text"]:focus {
  outline: none;
  border-color: #007bff;
}

button {
  width: 100%;
  padding: 12px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #0056b3;
}

#login-form {
  display: flex;
  flex-wrap: wrap; /* 画面が狭い時に折り返す設定（不要なら nowrap） */
  gap: 10px; /* ボタン同士の間隔 */
}

#api_return {
  background-color: #1e1e1e; /* ダークモード風 */
  color: #00ff00; /* ログらしいグリーン */
  padding: 10px;
  border-radius: 4px;
  font-family: monospace; /* 等幅フォント */
  font-size: 14px;
  line-height: 1.5;

  /* スクロールのための重要設定 */
  max-height: 400px; /* 縦幅の最大値 */
  overflow-y: auto; /* 溢れたらスクロールを表示 */
  border: 1px solid #333;
}

/* ローディングレイヤーの基本スタイル */
#loading-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5); /* 半透明の黒 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  /* 初期状態は非表示 */
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.3s,
    visibility 0.3s;
}

/* 表示状態のクラス */
#loading-layer.is-active {
  visibility: visible;
  opacity: 1;
}

/* スピナーの見た目 */
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #fff;
  border-top-color: #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 入力が無効（未入力など）な場合のスタイル */
input[type="text"].error {
  border-color: #dc3545; /* 赤枠 */
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25); /* ほんのり赤く光らせる */
}

/* エラーフキダシの本体 */
.error-message {
  display: none; /* 初期状態は非表示 */
  position: absolute;
  top: 100%; /* inputの直下に配置 */
  left: 0;
  margin-top: 8px; /* inputとの間隔 */
  padding: 10px 15px;
  background-color: #dc3545; /* 赤色背景 */
  color: white;
  font-size: 0.85rem;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 10; /* 他の要素の上に表示 */
}

/* フキダシの三角部分 */
.error-message::before {
  content: "";
  position: absolute;
  bottom: 100%; /* フキダシの上に配置 */
  left: 15px; /* 左側から少しずらす */
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #dc3545 transparent; /* 下向きの三角 */
}

/* JSで .show クラスがついた時だけ表示 */
.error-message.show {
  display: block;
}

/* QRcode */
#totp-area {
  padding-top: 1em;
  padding-bottom: 1em;
}
.qrcode-discription {
  padding-top: 1em;
  padding-bottom: 1em;
}
#qrcode.noqr, #totp-area.noqr, #totp-register-button.noqr {
  display: none;
}
#register-button.display_qr{
  display: none;
}
