/* ===== Auth Pages — Full-screen glassmorphism ===== */

/* Full-viewport background */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(to bottom right, #0f172a, #1e3a5f);
  font-family: 'Noto Sans JP', sans-serif;
  margin: 0;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}
@media (min-height: 700px) {
  .auth-page { align-items: center; }
}

/* Background image layer */
.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--auth-bg, none);
  background-size: cover;
  background-position: center;
  z-index: 0;
}

/* Gradient overlay on top of image */
.auth-page::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.82) 0%,
      rgba(37, 99, 235, 0.55) 45%,
      rgba(15, 118, 110, 0.45) 100%
    );
  z-index: 1;
}

/* Glassmorphism card */
.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  padding: clamp(32px, 5vw, 48px);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

/* Logo */
.auth-card__logo {
  text-align: center;
  margin-bottom: 8px;
  font-family: 'Montserrat', 'Noto Sans JP', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #2563eb;
}

/* Title */
.auth-card__title {
  text-align: center;
  margin: 0 0 28px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}

/* ===== Form ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Label above input */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  padding-left: 2px;
  letter-spacing: 0.02em;
}

.auth-field__input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid rgba(148, 163, 184, 0.5);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  font-family: inherit;
  color: #1e293b;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-field__input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
  background: rgba(255, 255, 255, 0.85);
}

/* Input + toggle wrapper (password field) */
.auth-field__wrap {
  position: relative;
}

.auth-field__wrap .auth-field__input {
  padding-right: 48px;
}

/* Password toggle button — centered inside input */
.auth-field__toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 1rem;
  padding: 4px;
  line-height: 1;
}

.auth-field__toggle:hover {
  color: #475569;
}

/* ===== Terms checkbox ===== */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0;
}

.auth-terms input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.auth-terms label {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
}

.auth-terms a {
  color: #2563eb;
  text-decoration: underline;
}

/* ===== Messages ===== */
.auth-errors {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  padding: 12px 16px;
  border-radius: 10px;
  list-style: none;
  margin: 0 0 8px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.auth-success {
  color: #059669;
  background: rgba(5, 150, 105, 0.08);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin: 0 0 8px;
  text-align: center;
}

/* ===== Submit button ===== */
.auth-submit {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 4px;
}

.auth-submit:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

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

.auth-submit:disabled {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ===== Divider ===== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  font-size: 0.85rem;
  color: #64748b;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.4);
}

/* ===== Google button ===== */
.gsi-material-button {
  display: block;
  margin: 0 auto;
  width: auto;
  max-width: 280px;
}

/* ===== Footer links ===== */
.auth-footer {
  text-align: center;
  margin-top: 12px;
  font-size: 0.88rem;
  color: #64748b;
}

.auth-footer a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* サービスリンク */
.auth-service-links {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}
.auth-service-links > p {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0 0 10px;
}
.auth-service-links__grid {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.auth-service-links__grid a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #64748b;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  background: #f1f5f9;
  transition: background 0.2s, color 0.2s;
}
.auth-service-links__grid a:hover {
  background: #e0e7ff;
  color: #2563eb;
}

/* ===== ラベル行（パスワード忘れリンク） ===== */
.auth-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-field__forgot {
  font-size: 0.78rem;
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.auth-field__forgot:hover {
  text-decoration: underline;
}

/* ===== カード説明テキスト ===== */
.auth-card__desc {
  text-align: center;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.7;
  margin: -8px 0 20px;
}

/* ===== 送信完了アイコン ===== */
.auth-sent-icon {
  text-align: center;
  font-size: 3rem;
  margin: 8px 0 4px;
  color: #2563eb;
}
.auth-sent-icon--success { color: #16a34a; }
.auth-sent-icon--error   { color: #dc2626; }

/* ===== パスワード強度バー ===== */
.pw-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.pw-strength__bar {
  flex: 1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.pw-strength__fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width 0.3s, background 0.3s;
  background: #94a3b8;
}
.pw-strength__fill.weak   { background: #ef4444; }
.pw-strength__fill.fair   { background: #f59e0b; }
.pw-strength__fill.good   { background: #22c55e; }
.pw-strength__fill.strong { background: #16a34a; }

.pw-strength__label {
  font-size: 0.75rem;
  color: #64748b;
  min-width: 56px;
  text-align: right;
}

/* ===== Mobile ===== */
@media (max-width: 767px) {
  .auth-page {
    align-items: flex-start;
    padding: 60px 16px 24px;
    background-attachment: scroll;
  }

  .auth-card {
    max-width: 100%;
    border-radius: 20px;
  }

  .gsi-material-button {
    width: 100%;
    max-width: none;
  }
}

/* ===== Dark mode ===== */
@media (prefers-color-scheme: dark) {
  .auth-card {
    background: rgba(17, 28, 48, 0.88);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow:
      0 24px 48px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  }

  .auth-card__logo {
    color: #60a5fa;
  }

  .auth-card__title {
    color: #e2e8f0;
  }

  .auth-field__label {
    color: #94a3b8;
  }

  .auth-field__input {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
  }

  .auth-field__input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    background: rgba(30, 41, 59, 0.9);
  }

  .auth-terms label {
    color: #94a3b8;
  }

  .auth-terms a {
    color: #60a5fa;
  }

  .auth-divider {
    color: #94a3b8;
  }

  .auth-divider::before,
  .auth-divider::after {
    background: rgba(148, 163, 184, 0.3);
  }

  .auth-submit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
  }

  .auth-footer {
    color: #94a3b8;
  }

  .auth-footer a {
    color: #60a5fa;
  }
}
