/* ========================================
   ログインページ専用スタイル（遊び心バージョン）
   ======================================== */

.login-container {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

/* 背景アニメーション要素 */
.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="login-stars" width="25" height="25" patternUnits="userSpaceOnUse"><circle cx="12.5" cy="12.5" r="1" fill="white" opacity="0.2"/><circle cx="6" cy="6" r="0.5" fill="white" opacity="0.1"/><circle cx="19" cy="19" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23login-stars)"/></svg>');
  animation: loginTwinkle 4s infinite;
}

@keyframes loginTwinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.4; }
}

/* メインカード */
.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-large);
  padding: var(--spacing-xl) var(--spacing-lg);
  text-align: center;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 2;
  animation: slideInUp 0.8s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ログインアイコン */
.login-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-md);
  animation: loginBounce 1s ease-out 0.3s both;
  display: block;
  color: var(--primary-color);
}

@keyframes loginBounce {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-50px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05) translateY(0);
  }
  70% {
    transform: scale(0.9) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* タイトル */
.login-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-base);
  color: var(--color-text);
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

/* サブタイトル */
.login-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  animation: fadeInUp 0.8s ease-out 0.7s both;
}

/* フォーム */
.login-form {
  animation: fadeInUp 0.8s ease-out 0.9s both;
}

/* エラーメッセージ */
.login-error-message {
  background: var(--danger-color);
  color: var(--text-light);
  padding: var(--spacing-base);
  border-radius: var(--radius-medium);
  margin-bottom: var(--spacing-md);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-sm);
  box-shadow: var(--shadow-md);
  animation: shake 0.5s ease;
  text-align: center;
}

.login-error-message__text {
  flex: 0 1 auto;
  line-height: 1.55;
  text-align: center;
}

.login-error-icon {
  flex-shrink: 0;
  display: flex;
  color: var(--text-light);
}

.login-error-icon svg {
  display: block;
  width: 50px;
  height: 50px;
  color: inherit;
}

/* フォームグループ */
.login-form-group {
  margin-bottom: var(--spacing-md);
  text-align: left;
}

.login-form-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-sm);
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.login-input-wrap:focus-within {
  transform: scale(1.01);
}

.login-input-wrap--password .login-form-input {
  padding-right: calc(var(--spacing-xl) + var(--spacing-base));
}

.login-input-icon {
  position: absolute;
  left: var(--spacing-base);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--text-muted, #94a3b8);
  pointer-events: none;
  z-index: 1;
}

.login-input-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  color: inherit;
}

.login-form-input {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--spacing-base) 0 calc(var(--spacing-xl) + var(--spacing-sm));
  border: 1px solid var(--border-color, var(--border-light));
  border-radius: var(--radius-medium);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.login-form-input::placeholder {
  color: var(--text-muted, #94a3b8);
  opacity: 0.85;
}

.login-form-input:hover {
  border-color: color-mix(in srgb, var(--primary-color) 35%, transparent);
}

.login-form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 18%, transparent);
  background: var(--bg-primary);
  transform: none;
}

.login-form-input:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.login-form-input.error {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
  animation: shake 0.5s ease;
}

.login-form-input.error:focus-visible {
  outline: 2px solid var(--danger-color);
  outline-offset: 2px;
}

/* パスワード表示切り替え */
.login-password-toggle {
  position: absolute;
  right: var(--spacing-sm);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.login-password-toggle:hover {
  background: var(--bg-secondary);
  color: var(--primary-color);
  transform: translateY(-50%);
}

.login-password-toggle:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.login-toggle-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  color: inherit;
}

/* 入力ヒント */
.login-form-hint {
  margin: var(--spacing-xs) 0 0;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* チェックボックス */
.login-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.login-checkbox-label {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-sm) + var(--spacing-xs));
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* 実際のチェックボックスを非表示（ログインページ内のみスコープし他ページへ干渉しない） */
.login-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.login-checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-small);
  position: relative;
  flex-shrink: 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.login-container input[type="checkbox"]:checked + .login-checkbox-label .login-checkbox-custom {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.login-container input[type="checkbox"]:focus-visible + .login-checkbox-label .login-checkbox-custom {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

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

/* ログインボタン */
.login-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  width: 100%;
  padding: var(--spacing-base) var(--spacing-lg);
  border: none;
  border-radius: var(--radius-large);
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--spacing-md);
}

.login-submit-btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.login-submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: transparent;
  transition: left 0.5s ease;
}

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

.login-submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

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

/* ログインフッター */
.login-footer {
  border-top: 1px solid var(--border-light);
  padding-top: var(--spacing-md);
  margin-top: var(--spacing-md);
  animation: fadeInUp 0.8s ease-out 1.1s both;
}

.login-footer p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

.login-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.login-footer a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.login-footer a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* フローティング要素 */
.login-floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.login-floating-element {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.2;
  animation: loginFloat 8s ease-in-out infinite;
}

.login-floating-element:nth-child(1) {
  top: 15%;
  left: 10%;
  animation-delay: 0s;
}

.login-floating-element:nth-child(2) {
  top: 25%;
  right: 15%;
  animation-delay: 2s;
}

.login-floating-element:nth-child(3) {
  bottom: 25%;
  left: 15%;
  animation-delay: 4s;
}

.login-floating-element:nth-child(4) {
  bottom: 15%;
  right: 10%;
  animation-delay: 6s;
}

@keyframes loginFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(180deg);
  }
}

/* アニメーション */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .login-container {
    padding: 20px 15px;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }

  .login-title {
    font-size: 2rem;
  }

  .login-icon {
    font-size: 3rem;
  }

  .login-floating-elements {
    display: none;
  }
}

@media (max-width: 480px) {
  .login-title {
    font-size: 1.8rem;
  }

  .login-icon {
    font-size: 2.5rem;
  }

  .login-form-input {
    min-height: 48px;
  }

  .login-submit-btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}
