/* ============================
   CITR Login Page Styles
   ============================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #60a5fa;
  --primary-dim: #3b82f6;
  --primary-container: #dbeafe;
  --on-primary: #1e3a5f;
  --secondary: #93c5fd;
  --secondary-container: #e0f2fe;
  --on-secondary: #fff;
  --tertiary: #a5b4fc;
  --surface: #fff;
  --surface-container: #f0f4f8;
  --surface-container-low: #f8fafc;
  --on-surface: #1e293b;
  --on-surface-variant: #475569;
  --outline: #94a3b8;
  --outline-variant: #cbd5e1;
  --error: #dc2626;
  --font-headline: 'Space Grotesk', 'Noto Sans TC', sans-serif;
  --font-body: 'Inter', 'Noto Sans TC', sans-serif;
}

html,
body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 30%, #7dd3fc 60%, #60a5fa 100%);
  position: relative;
  overflow: hidden;
}

/* Animated background orbs */
body::before,
body::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  z-index: 0;
}

body::before {
  width: 600px;
  height: 600px;
  background: var(--tertiary);
  top: -200px;
  right: -200px;
  animation: float1 8s ease-in-out infinite;
}

body::after {
  width: 500px;
  height: 500px;
  background: var(--secondary);
  bottom: -150px;
  left: -150px;
  animation: float2 10s ease-in-out infinite;
}

@keyframes float1 {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(-40px, 40px);
  }
}

@keyframes float2 {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(40px, -30px);
  }
}

/* Dot pattern overlay */
.bg-pattern {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 2px 2px, rgba(59, 130, 246, 0.06) 1px, transparent 0);
  background-size: 32px 32px;
  z-index: 0;
  pointer-events: none;
}

/* Login card */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  margin: 1rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(147, 197, 253, 0.4);
  border-radius: 1.5rem;
  padding: 3rem 2.5rem 2.5rem;
  box-shadow:
    0 25px 50px -12px rgba(59, 130, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: cardFadeIn 0.6s ease-out;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

/* Logo area */
.logo-area {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-area img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.logo-area h1 {
  font-family: var(--font-headline);
  font-size: 22px;
  font-weight: 700;
  color: #1e3a5f;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 4px;
}

.logo-area .subtitle {
  font-size: 12px;
  color: rgba(30, 58, 95, 0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Form elements */
.form-group {
  margin-bottom: 1.25rem;
}

.login-card .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper .icon {
  position: absolute;
  left: 1rem;
  font-size: 1.2rem;
  color: rgba(59, 130, 246, 0.4);
  pointer-events: none;
  transition: color 0.2s;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: rgba(241, 245, 249, 0.8);
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  color: #1e293b;
  font-size: 16px;
  font-family: var(--font-body);
  outline: none;
  transition: all 0.25s ease;
  height: auto;
}

.input-wrapper input::placeholder {
  color: rgba(100, 116, 139, 0.6);
}

.input-wrapper input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.input-wrapper input:focus+.icon,
.input-wrapper input:focus~.icon {
  color: var(--primary);
}

/* reCAPTCHA */
.recaptcha-area {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  transform: scale(0.92);
  transform-origin: center;
}

/* Submit button */
.btn-submit {
  width: 100%;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dim) 100%);
  color: var(--on-primary);
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
}

/* Shine effect */
.btn-submit::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: skewX(-12deg);
  transition: left 0.6s ease;
}

.btn-submit:hover::after {
  left: 120%;
}

/* Footer */
.login-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.login-footer p {
  font-size: 11px;
  color: rgba(71, 85, 105, 0.5);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 480px) {
  .login-card {
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 1.25rem;
    margin: 0.75rem;
  }

  .logo-area img {
    width: 56px;
    height: 56px;
  }

  .logo-area h1 {
    font-size: 1.15rem;
  }

  .recaptcha-area {
    transform: scale(0.82);
  }
}

/* ============================
   Fancybox / Lightbox Override
   ============================ */

/* Overlay */
.fancybox-overlay {
  background: rgba(30, 58, 95, 0.5) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Lightbox container */
.fancybox-wrap,
.fancybox-skin {
  border-radius: 16px !important;
  overflow: hidden;
}

.fancybox-skin {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
  padding: 32px 36px !important;
}

.fancybox-inner {
  overflow: visible !important;
  width: auto !important;
  height: auto !important;
  min-width: 280px;
  max-width: 400px;
  text-align: center;
}

/* Message text */
.fancybox-inner h2,
.fancybox-inner p,
.fancybox-inner div {
  font-family: 'Inter', 'Noto Sans TC', sans-serif !important;
  color: #1b1c1c !important;
  font-size: 16px !important;
  line-height: 1.6 !important;
  margin-bottom: 20px;
}

/* Confirm link → styled button */
.fancybox-inner a {
  display: inline-block !important;
  padding: 10px 40px !important;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
  color: #fff !important;
  font-family: 'Space Grotesk', 'Noto Sans TC', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  border-radius: 10px !important;
  letter-spacing: 0.02em;
  transition: all 0.25s ease !important;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  cursor: pointer;
}

.fancybox-inner a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* Close button */
.fancybox-close {
  top: 10px !important;
  right: 10px !important;
  width: 32px !important;
  height: 32px !important;
  background: rgba(0, 0, 0, 0.06) !important;
  border-radius: 50% !important;
  text-indent: 0 !important;
  line-height: 32px !important;
  text-align: center !important;
  font-size: 18px !important;
  color: #666 !important;
  transition: all 0.2s ease;
}

.fancybox-close:hover {
  background: rgba(0, 0, 0, 0.12) !important;
  color: #333 !important;
}

/* ============================
   Register / Verify Page
   ============================ */

.verify-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 1rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(147, 197, 253, 0.4);
  border-radius: 1.5rem;
  padding: 3rem 2.5rem 2.5rem;
  box-shadow:
    0 25px 50px -12px rgba(59, 130, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: cardFadeIn 0.6s ease-out;
}

/* Verify header */
.verify-header {
  text-align: center;
  margin-bottom: 2rem;
}

.verify-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dim) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

.verify-icon .material-symbols-outlined {
  font-size: 36px;
  color: var(--on-primary);
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
  }

  50% {
    box-shadow: 0 8px 36px rgba(59, 130, 246, 0.5);
  }
}

.verify-header h1 {
  font-family: var(--font-headline);
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e3a5f;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.verify-header p {
  font-size: 0.85rem;
  color: rgba(30, 58, 95, 0.5);
  line-height: 1.5;
}

.verify-header .email-hint {
  color: var(--primary);
  font-weight: 600;
}

/* Verify code input overrides */
.verify-card .form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.verify-card .input-wrapper input {
  font-size: 1.5rem;
  font-family: var(--font-headline);
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
}

.verify-card .input-wrapper input::placeholder {
  color: rgba(100, 116, 139, 0.5);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  font-weight: 400;
}

/* Back button */
.btn-back {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 1rem;
  padding: 0.7rem;
  background: transparent;
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.75rem;
  color: #475569;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-back:hover {
  border-color: rgba(59, 130, 246, 0.4);
  color: #1e3a5f;
  background: rgba(59, 130, 246, 0.05);
}

/* Verify footer */
.verify-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.verify-footer p {
  font-size: 0.65rem;
  color: rgba(71, 85, 105, 0.5);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Verify responsive */
@media (max-width: 480px) {
  .verify-card {
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 1.25rem;
    margin: 0.75rem;
  }

  .verify-icon {
    width: 60px;
    height: 60px;
  }

  .verify-icon .material-symbols-outlined {
    font-size: 30px;
  }

  .verify-header h1 {
    font-size: 1.15rem;
  }

  .verify-card .input-wrapper input {
    font-size: 1.25rem;
  }

  .recaptcha-area {
    transform: scale(0.82);
  }
}
