/* =======================================================
   login_userpage.css
   - 背景particles（常時）
   - ログイン成功：パーティクル・ワイプ（左下→右上）
   ※ 旧 #loading-overlay / ローダー系は「不使用」なので削除
======================================================= */

* { box-sizing: border-box; }

html, body { height: 100%; }

/* =======================================================
   ベース
======================================================= */
body{
  margin: 0;
  padding: 0;
  min-height: 100vh; /* 100vhの挙動差を少し緩和 */
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "ヒラギノ明朝 ProN W6", "游明朝", "MS 明朝", serif;
  color: #fff;
  overflow: hidden;
}

/* 黒透明レイヤー（背景の締め） */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse at center,
      rgba(0,0,0,0.80) 0%,
      rgba(0,0,0,0.87) 55%,
      rgba(0,0,0,0.95) 100%
    );
  z-index: 0;
  pointer-events: none;
}

/* =======================================================
   背景：particles（常時）
======================================================= */
#particles-js{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;            /* body::before(0)より上 */
  pointer-events: none;  /* フォーム操作を邪魔しない */
}

/* =======================================================
   ログインボックス
======================================================= */
.container{
  position: relative;
  z-index: 2;            /* 背景より上 */
  text-align: center;
  max-width: 400px;
  width: min(90%, 420px);
  padding: 0 8px;
}

.container img.icon{
  width: 120px;
  height: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.60));
}

.catchphrase{
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

/* =======================================================
   フォームデザイン
======================================================= */
form{
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.40);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

input[type="text"],
input[type="password"]{
  width: 92%;
  padding: 0.7rem;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.85);
  font-size: 1rem;
  text-align: center;
}

input[type="text"]:focus,
input[type="password"]:focus{
  outline: none;
  background: #fff;
}

input[type="submit"]{
  width: 100%;
  padding: 0.8rem;
  background-color: #BF4E4E;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1rem;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.08s ease;
}

input[type="submit"]:hover{
  background-color: #ffd74a;
}

input[type="submit"]:active{
  transform: translateY(1px);
}

.error{
  color: #ff6b6b;
  font-size: 0.9rem;
  margin: 0;
}

/* =======================================================
   ログイン成功：パーティクル・ワイプ（滑らか版）
   - clip-path ではなく transform で動かす
======================================================= */
#login-wipe{
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  overflow: hidden; /* はみ出し隠す */
}

/* 斜めの「板」（ベール）を transform でスライドさせる */
#login-wipe::before{
  content: "";
  position: absolute;
  left: -140%;
  top: -140%;
  width: 280%;
  height: 280%;

  /* 左下→右上に伸びるようなベール感 */
  background: linear-gradient(
    45deg,
    rgba(0,0,0,0.00) 0%,
    rgba(0,0,0,0.35) 35%,
    rgba(0,0,0,0.80) 70%,
    rgba(0,0,0,0.95) 100%
  );

  transform: translate3d(-60%, 60%, 0) rotate(0.01deg);
  will-change: transform;
}

/* ワイプの中身（particlesの描画先） */
#login-wipe-particles{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.0;              /* 最初は見せない */
  transition: opacity 0.4s ease;
}

/* ワイプ開始 */
#login-wipe.active{
  opacity: 1;
}

/* active時：板をスーッと通過させる（滑らか） */
#login-wipe.active::before{
  animation: veilSlide 3500ms cubic-bezier(.2,.8,.2,1) forwards;
}

/* particlesも少し遅れて出すと気持ちいい */
#login-wipe.active #login-wipe-particles{
  opacity: 1;
  transition-delay: 1500ms;
}

/* 左下→右上に “覆っていく” */
@keyframes veilSlide{
  0%{
    transform: translate3d(-65%, 65%, 0) rotate(45deg);
  }
  100%{
    transform: translate3d(65%, -65%, 0) rotate(135deg);
  }
}

/* 動きが苦手な人向け */
@media (prefers-reduced-motion: reduce){
  #login-wipe.active::before{
    animation: none;
    transform: translate3d(0, 0, 0) rotate(0.01deg);
  }
  #login-wipe.active #login-wipe-particles{
    transition-delay: 0ms;
  }
}

/* =======================================================
   スマホ微調整
======================================================= */
@media (max-width: 420px){
  .container img.icon{ width: 104px; }
  .catchphrase{ font-size: 1.2rem; }
  form{ padding: 1.2rem; }
}
