/* ============================================================
   ログイン画面 スタイルシート
   対象: index.html
   ============================================================ */

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

body {
  font-family: 'Noto Sans JP', sans-serif;
  min-height: 100vh;
  background: radial-gradient(ellipse at 60% 40%, #d6e8fb 0%, #eaf3fc 40%, #f0f6ff 70%, #e8eef8 100%);
  display: flex;
  flex-direction: column;
}

/* ============================================================
   ヘッダー
   ============================================================ */
.site-header {
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 0.02em;
}

.logo-text span {
  color: #1d4ed8;
}

.site-title {
  font-size: 16px;
  font-weight: 600;
  color: #334155;
  padding-left: 12px;
  border-left: 2px solid #cbd5e1;
}

/* ============================================================
   メインコンテンツ
   ============================================================ */
.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ============================================================
   ログインカード
   ============================================================ */
.login-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 36px 40px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 16px rgba(30, 64, 175, 0.10), 0 1px 4px rgba(0,0,0,0.06);
}

.card-title {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 28px;
  letter-spacing: 0.04em;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 11px;
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Noto Sans JP', sans-serif;
  color: #1e293b;
  background: #fefce8;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-input:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input::placeholder {
  color: #b0bec5;
}

.form-input.error {
  border-color: #ef4444;
  background: #fff5f5;
}

.form-input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* ============================================================
   パスワード表示切替ボタン
   ============================================================ */
.toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  outline: none;
  transition: color 0.2s;
}

.toggle-password:hover {
  color: #3b82f6;
}

/* ============================================================
   エラーメッセージ
   ============================================================ */
.error-message {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #ef4444;
  margin-top: 5px;
}

.error-message.show {
  display: flex;
}

/* ============================================================
   ログインボタン
   ============================================================ */
.btn-login {
  width: 100%;
  padding: 11px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  letter-spacing: 0.08em;
  margin-top: 8px;
  transition: background 0.2s, box-shadow 0.2s;
  position: relative;
}

.btn-login:hover {
  background: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-login:active {
  background: #1d4ed8;
}

.btn-login.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-login .btn-text  { display: inline; }
.btn-login .btn-spinner { display: none; }
.btn-login.loading .btn-text    { display: none; }
.btn-login.loading .btn-spinner { display: inline; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-icon {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

/* ============================================================
   成功バナー
   ============================================================ */
.success-banner {
  display: none;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 18px;
  color: #16a34a;
  font-size: 13px;
  font-weight: 500;
}

.success-banner.show {
  display: flex;
}

/* ============================================================
   APIエラーバナー
   ============================================================ */
.api-error-banner {
  display: none;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 18px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 500;
}

.api-error-banner.show {
  display: flex;
}

/* ============================================================
   パスワード忘れリンク
   ============================================================ */
.forgot-wrap {
  text-align: right;
  margin-top: 10px;
}

.forgot-link {
  font-size: 12px;
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s;
}

.forgot-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 480px) {
  .login-card {
    padding: 28px 22px 24px;
  }
  .site-header {
    padding: 14px 16px;
  }
  .site-title {
    font-size: 13px;
  }
}
