@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700;900&display=swap');

/* =============================================
   Login Page - Premium Design v2.1
   ============================================= */

/* --- Page Background (animated gradient) --- */
.login-page {
  background:
    radial-gradient(ellipse 120% 80% at 20% 10%, rgba(59, 130, 246, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 100% 60% at 80% 90%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
    linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f1f5ff 100%);
  background-size: 200% 200%;
  animation: login-bg-shift 12s ease-in-out infinite;
  color: #334155;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  font-family: "Noto Sans JP", sans-serif;
  min-height: 100vh;
}

@keyframes login-bg-shift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* --- Card Container (glassmorphism) --- */
.login-container {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-radius: 28px;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.09),
    0 8px 20px rgba(37, 99, 235, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.7);
  animation: login-card-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes login-card-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- Header & Logo --- */
.login-visual {
  padding: 30px 20px 20px 20px;
  background-color: #ebf5fb;
  text-align: center;
}

.login-header {
  text-align: center;
  margin-bottom: 0.35rem;
  padding-top: 0.25rem;
}

.login-logo-modern {
  font-family: 'Nunito', sans-serif;
  font-size: 3.2rem;
  margin: 0;
  line-height: 1.1;
  text-align: center;
  letter-spacing: -0.03em;
  position: relative;
}

.logo-kids {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
}

.logo-pass {
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* --- Catchphrase --- */
.login-catchphrase {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.08em;
  margin: 0 0 1.2rem 0;
  position: relative;
}

.login-catchphrase::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  margin: 0.75rem auto 0;
  border-radius: 2px;
  opacity: 0.75;
}

/* --- Visual Image --- */
.login-visual-container {
  margin: 0.5rem 0 1.5rem;
  text-align: center;
  padding: 0 6px;
}

.login-visual-img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow:
    0 6px 20px rgba(37, 99, 235, 0.10),
    0 2px 8px rgba(0, 0, 0, 0.05);
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.login-visual-img:hover {
  transform: scale(1.02);
  box-shadow:
    0 10px 28px rgba(37, 99, 235, 0.14),
    0 4px 12px rgba(0, 0, 0, 0.06);
}

/* --- Form Wrapper --- */
.login-form-wrapper {
  padding: 28px 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* --- Heading --- */
.login-heading {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.login-subtitle {
  margin: 0;
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.5;
}

/* --- Form Fields (enhanced) --- */
.login-form .form-group input,
.register-form .form-group input {
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: rgba(248, 250, 252, 0.8);
  color: #0f172a;
  font-size: 0.95rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.login-form .form-group input:focus,
.register-form .form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: #ffffff;
}

.login-form .form-group input::placeholder,
.register-form .form-group input::placeholder {
  color: #94a3b8;
}

.login-form .form-group label,
.register-form .form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.02em;
}

/* --- Fallback Notice --- */
.style-fallback-notice {
  display: none;
}

.login-page.login-fallback-active .style-fallback-notice {
  display: block;
  margin: 0;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fff7ed;
}

/* --- Login Button (premium) --- */
.login-submit-button {
  margin-top: 4px;
  padding: 0.8rem 1.5rem;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow:
    0 6px 20px rgba(37, 99, 235, 0.28),
    0 2px 6px rgba(37, 99, 235, 0.12);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, background 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-submit-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}

.login-submit-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 28px rgba(37, 99, 235, 0.32),
    0 4px 10px rgba(37, 99, 235, 0.18);
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.login-submit-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

.login-submit-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.4);
  outline-offset: 3px;
}

/* --- Secondary Buttons --- */
.login-actions {
  display: flex;
  justify-content: center;
}

.login-secondary-button {
  padding: 0.65rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  background: rgba(241, 245, 249, 0.9);
  color: #1d4ed8;
  border: 1.5px solid rgba(37, 99, 235, 0.22);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.06);
}

.login-secondary-button:hover {
  background: rgba(219, 234, 254, 0.8);
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.10);
  transform: translateY(-1px);
}

.register-submit-button {
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.register-submit-button:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.30);
  transform: translateY(-1px);
}

.register-cancel-button {
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  background: rgba(241, 245, 249, 0.9);
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.register-cancel-button:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* --- Register Panel (animated) --- */
.register-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 16px;
  background: rgba(241, 245, 249, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.8);
  animation: register-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes register-slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.register-panel[hidden] {
  display: none;
}

.register-header {
  display: grid;
  gap: 8px;
}

.register-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
  font-weight: 700;
}

.register-header p {
  margin: 0;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.6;
}

.register-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.register-message {
  font-size: 0.85rem;
}

/* --- Info Notes --- */
.login-note {
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
  color: #1e3a8a;
  border: 1px solid rgba(191, 219, 254, 0.5);
}

.login-note p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.login-support-info {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.5;
}

.login-message {
  min-height: 24px;
  font-size: 0.88rem;
  text-align: center;
  color: #1f2933;
  padding: 0 4px;
}

.login-links {
  text-align: center;
  font-size: 0.82rem;
  color: #64748b;
}

.login-links p {
  margin: 0;
}

.login-links a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.login-links a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* --- Footer / Version --- */
.login-footer {
  margin-top: 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  padding-top: 16px;
  display: grid;
  gap: 10px;
}

.login-footer-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.app-version {
  display: grid;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.app-version-message {
  margin: 0;
  text-align: center;
}

.app-version-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.75rem;
  margin: 0;
}

.app-version-list dt {
  font-weight: 600;
  color: #64748b;
}

.app-version-list dd {
  margin: 0;
}

.app-version-notice {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: #e0f2fe;
  color: #0f172a;
  font-size: 0.8rem;
}

.app-version-warning {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: #fff7ed;
  color: #b45309;
  border: 1px solid rgba(251, 191, 36, 0.4);
  font-size: 0.8rem;
}

/* --- Future Factor --- */
.login-future-factor {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px dashed #bfdbfe;
  background: rgba(191, 219, 254, 0.12);
  color: #1e3a8a;
  font-size: 0.82rem;
}

/* --- Responsive --- */
@media (min-width: 768px) {
  .login-page {
    padding: 40px;
  }

  .login-container {
    flex-direction: column !important;
    max-width: 480px !important;
  }

  .login-form-wrapper {
    padding: 36px 36px 44px !important;
  }

  .register-actions {
    flex-direction: row;
    align-items: center;
  }

  .login-logo-modern {
    font-size: 3.5rem;
  }
}

@media (max-width: 380px) {
  .login-form-wrapper {
    padding: 20px 18px 28px;
  }

  .login-logo-modern {
    font-size: 2.6rem;
  }

  .login-heading {
    font-size: 1.05rem;
  }
}