/**
 * Social9 認証画面スタイル
 * 
 * 自然なアースカラーをベースにしたモダンなデザイン
 * メイン: オレンジ(#EE822B)・緑(#4D8632)
 * セカンダリ: 黄緑(#A8D239)
 * アクセント: 赤(#CC493E)
 */

/* =============================================================================
   フォント設定
   ============================================================================= */

:root {
  --font-display: 'Outfit', 'Noto Sans JP', sans-serif;
}

/* =============================================================================
   認証ページレイアウト
   ============================================================================= */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, 
    #1a1c1a 0%, 
    #2a3328 30%,
    #3d4a38 60%, 
    #2a3328 100%
  );
  position: relative;
  overflow: hidden;
}

/* 背景メッシュグラデーション - オレンジと緑 */
.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(238, 130, 43, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 75% 70%, rgba(77, 134, 50, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(168, 210, 57, 0.15) 0%, transparent 50%);
  animation: mesh-float 25s ease-in-out infinite;
}

.auth-page::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
}

@keyframes mesh-float {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(2deg);
  }
}

/* 浮遊する装飾シェイプ */
.floating-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.floating-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.shape-1 {
  width: 350px;
  height: 350px;
  top: -80px;
  right: -80px;
  background: linear-gradient(135deg, rgba(238, 130, 43, 0.3), rgba(238, 130, 43, 0.05));
  animation: float-1 18s ease-in-out infinite;
}

.shape-2 {
  width: 280px;
  height: 280px;
  bottom: -60px;
  left: -60px;
  background: linear-gradient(135deg, rgba(77, 134, 50, 0.35), rgba(168, 210, 57, 0.1));
  animation: float-2 22s ease-in-out infinite;
}

.shape-3 {
  width: 180px;
  height: 180px;
  top: 50%;
  left: 15%;
  background: linear-gradient(135deg, rgba(168, 210, 57, 0.25), rgba(77, 134, 50, 0.1));
  animation: float-3 20s ease-in-out infinite;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-25px, 25px) scale(1.08); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -15px) scale(0.92); }
}

@keyframes float-3 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(35px, -15px); }
  66% { transform: translate(-15px, 35px); }
}

/* =============================================================================
   認証コンテナ
   ============================================================================= */

.auth-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  animation: card-appear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes card-appear {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-card {
  background: rgba(28, 32, 28, 0.85);
  backdrop-filter: blur(40px) saturate(150%);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  border-radius: 28px;
  padding: 48px 40px;
  box-shadow: 
    0 0 0 1px rgba(168, 210, 57, 0.08),
    0 4px 24px rgba(0, 0, 0, 0.25),
    0 24px 80px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}

/* カードのグロー効果 - オレンジから緑へ */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(238, 130, 43, 0.5) 25%, 
    rgba(168, 210, 57, 0.7) 50%, 
    rgba(77, 134, 50, 0.5) 75%, 
    transparent
  );
}

/* =============================================================================
   デコレーションリング
   ============================================================================= */

.auth-decoration {
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 200px;
  height: 200px;
  pointer-events: none;
  opacity: 0.5;
}

.auth-decoration-ring {
  position: absolute;
  border: 1px solid rgba(77, 134, 50, 0.3);
  border-radius: 50%;
  animation: ring-pulse 4s ease-in-out infinite;
}

.auth-decoration-ring:nth-child(1) {
  width: 100px;
  height: 100px;
  right: 50px;
  bottom: 50px;
  border-color: rgba(238, 130, 43, 0.3);
  animation-delay: 0s;
}

.auth-decoration-ring:nth-child(2) {
  width: 150px;
  height: 150px;
  right: 25px;
  bottom: 25px;
  border-color: rgba(168, 210, 57, 0.25);
  animation-delay: 0.5s;
}

.auth-decoration-ring:nth-child(3) {
  width: 200px;
  height: 200px;
  right: 0;
  bottom: 0;
  border-color: rgba(77, 134, 50, 0.2);
  animation-delay: 1s;
}

@keyframes ring-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

/* =============================================================================
   ロゴ・ヘッダー
   ============================================================================= */

.auth-header {
  text-align: center;
  margin-bottom: 36px;
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #EE822B 0%, #A8D239 50%, #4D8632 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 
    0 4px 20px rgba(238, 130, 43, 0.4),
    0 0 40px rgba(77, 134, 50, 0.25);
  animation: icon-glow 4s ease-in-out infinite;
}

@keyframes icon-glow {
  0%, 100% { 
    box-shadow: 0 4px 20px rgba(238, 130, 43, 0.4), 0 0 40px rgba(77, 134, 50, 0.25); 
  }
  50% { 
    box-shadow: 0 4px 30px rgba(238, 130, 43, 0.6), 0 0 60px rgba(77, 134, 50, 0.35); 
  }
}

.auth-logo-text {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #f8f6f2 0%, #A8D239 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: #f5f3ef;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 15px;
  color: #a8a59d;
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.5;
}

/* =============================================================================
   フォーム
   ============================================================================= */

.auth-form {
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

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

.auth-form .form-label {
  color: #c4c1ba;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}

.auth-form .form-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(168, 210, 57, 0.15);
  color: #f5f3ef;
  padding: 16px 18px;
  font-size: 16px;
  border-radius: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-form .form-input:hover {
  border-color: rgba(168, 210, 57, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.auth-form .form-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: #EE822B;
  box-shadow: 
    0 0 0 4px rgba(238, 130, 43, 0.12),
    0 0 20px rgba(238, 130, 43, 0.08);
  outline: none;
}

.auth-form .form-input::placeholder {
  color: #6a6860;
}

.auth-form .form-hint {
  color: #7a7872;
  font-size: 12px;
  margin-top: 6px;
}

/* パスワード表示切替 */
.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6a6860;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.password-toggle:hover {
  color: #a8a59d;
  background: rgba(255, 255, 255, 0.08);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

/* =============================================================================
   パスワード強度インジケーター
   ============================================================================= */

.password-strength {
  margin-top: 12px;
}

.password-strength-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.password-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.password-strength-fill.weak {
  width: 33%;
  background: linear-gradient(90deg, #CC493E, #e05b50);
}

.password-strength-fill.medium {
  width: 66%;
  background: linear-gradient(90deg, #EE822B, #f59d4d);
}

.password-strength-fill.strong {
  width: 100%;
  background: linear-gradient(90deg, #4D8632, #6ba348);
}

.password-strength-text {
  font-size: 12px;
  color: #7a7872;
  font-weight: 500;
}

.password-strength-text.weak { color: #e05b50; }
.password-strength-text.medium { color: #f59d4d; }
.password-strength-text.strong { color: #6ba348; }

/* =============================================================================
   送信ボタン
   ============================================================================= */

.auth-submit {
  width: 100%;
  padding: 18px 24px;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, #EE822B 0%, #d97320 100%);
  border: none;
  border-radius: 14px;
  color: white;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f59d4d 0%, #EE822B 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 30px rgba(238, 130, 43, 0.45),
    0 0 50px rgba(238, 130, 43, 0.2);
}

.auth-submit:hover:not(:disabled)::before {
  opacity: 1;
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

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

.auth-submit span {
  position: relative;
  z-index: 1;
}

.auth-submit .spinner {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

/* =============================================================================
   メッセージ
   ============================================================================= */

.auth-message {
  padding: 16px 20px;
  border-radius: 14px;
  font-size: 14px;
  margin-bottom: 24px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: message-appear 0.3s ease-out;
}

@keyframes message-appear {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-message.success {
  background: rgba(77, 134, 50, 0.15);
  color: #6ba348;
  border: 1px solid rgba(77, 134, 50, 0.3);
}

.auth-message.error {
  background: rgba(204, 73, 62, 0.15);
  color: #e05b50;
  border: 1px solid rgba(204, 73, 62, 0.3);
}

/* =============================================================================
   リンク・フッター
   ============================================================================= */

.auth-links {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(168, 210, 57, 0.1);
  position: relative;
  z-index: 1;
}

.auth-links p {
  font-size: 14px;
  color: #a8a59d;
  margin-bottom: 12px;
}

.auth-register-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: rgba(77, 134, 50, 0.12);
  border: 1px solid rgba(77, 134, 50, 0.3);
  border-radius: 12px;
  color: #6ba348;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.25s;
  text-decoration: none;
}

.auth-register-link:hover {
  background: rgba(77, 134, 50, 0.2);
  border-color: rgba(77, 134, 50, 0.5);
  color: #7fb558;
  transform: translateY(-1px);
  text-decoration: none;
}

.auth-forgot {
  display: block;
  text-align: right;
  font-size: 13px;
  color: #7a7872;
  margin-top: 8px;
  transition: color 0.2s;
}

.auth-forgot:hover {
  color: #EE822B;
  text-decoration: none;
}

/* =============================================================================
   未成年注意表示
   ============================================================================= */

.minor-notice {
  background: rgba(238, 130, 43, 0.1);
  border: 1px solid rgba(238, 130, 43, 0.3);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 24px;
  display: none;
  animation: notice-appear 0.3s ease-out;
}

@keyframes notice-appear {
  from { opacity: 0; height: 0; padding: 0; margin: 0; }
  to { opacity: 1; }
}

.minor-notice.visible {
  display: block;
}

.minor-notice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #EE822B;
  margin-bottom: 6px;
}

.minor-notice-text {
  font-size: 13px;
  color: #f59d4d;
  line-height: 1.5;
}

/* =============================================================================
   日付入力
   ============================================================================= */

.date-inputs {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
}

.date-inputs .form-select {
  padding: 16px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(168, 210, 57, 0.15);
  color: #f5f3ef;
  border-radius: 14px;
  font-size: 15px;
  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='%23a8a59d' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: all 0.25s;
}

.date-inputs .form-select:hover {
  border-color: rgba(168, 210, 57, 0.3);
  background-color: rgba(255, 255, 255, 0.08);
}

.date-inputs .form-select:focus {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #EE822B;
  box-shadow: 0 0 0 4px rgba(238, 130, 43, 0.12);
  outline: none;
}

.date-inputs .form-select option {
  background: #1e211e;
  color: #f5f3ef;
}

/* =============================================================================
   レスポンシブ
   ============================================================================= */

@media (max-width: 480px) {
  .auth-page {
    padding: 16px;
    align-items: flex-start;
    padding-top: 40px;
  }
  
  .auth-card {
    padding: 36px 24px;
    border-radius: 24px;
  }
  
  .auth-logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  
  .auth-logo-icon svg {
    width: 24px;
    height: 24px;
  }
  
  .auth-logo-text {
    font-size: 26px;
  }
  
  .auth-title {
    font-size: 24px;
  }
  
  .auth-subtitle {
    font-size: 14px;
  }
  
  .auth-form .form-input {
    padding: 14px 16px;
    font-size: 16px; /* iOS zoom prevention */
  }
  
  .auth-submit {
    padding: 16px 20px;
  }
  
  .date-inputs {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .floating-shapes {
    display: none;
  }
  
  .auth-decoration {
    right: -80px;
    bottom: -80px;
    opacity: 0.3;
  }
}

/* =============================================================================
   アニメーション制御（アクセシビリティ）
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  .auth-page::before,
  .floating-shape,
  .auth-logo-icon,
  .auth-decoration-ring {
    animation: none;
  }
  
  .auth-container {
    animation: none;
  }
}
