/* Auth login page */

/* Base */
body {
  font-family: "IBM Plex Sans Thai", "IBM Plex Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1,
h2 {
  font-family: Anuphan, "IBM Plex Sans Thai", sans-serif;
}
@media (max-width: 639px) {
  input {
    font-size: 16px !important;
  }
}

/* Shell layout */
.auth-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .auth-shell {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.auth-form-col {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
}

/* Shared back-to-home control (login / signup / set-password) */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem 0.4rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid rgba(201, 211, 219, 0.75);
  background: rgba(255, 255, 255, 0.92);
  color: #495057;
  box-shadow: 0 1px 2px rgba(26, 28, 30, 0.04);
  text-decoration: none;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s ease;
}
.auth-back:hover {
  color: #3d86c2;
  border-color: rgba(79, 152, 211, 0.45);
  background: #eef6fc;
  box-shadow: 0 4px 14px rgba(79, 152, 211, 0.12);
}
.auth-back:active {
  transform: scale(0.97);
}
.auth-back-icon {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 9999px;
  background: rgba(79, 152, 211, 0.12);
  color: #4f98d3;
  font-size: 1.05rem !important;
  line-height: 1;
}
.auth-back:hover .auth-back-icon {
  background: rgba(79, 152, 211, 0.2);
}
.auth-back-text {
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}
@media (max-width: 639px) {
  .auth-back {
    padding: 0.35rem;
    width: 2.5rem;
    height: 2.5rem;
    justify-content: center;
  }
  .auth-back-text {
    display: none;
  }
  .auth-back-icon {
    width: 100%;
    height: 100%;
    background: transparent;
  }
}
.dark .auth-back {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(201, 211, 219, 0.2);
  color: #c5ced6;
}
.dark .auth-back:hover {
  background: rgba(79, 152, 211, 0.16);
  border-color: rgba(79, 152, 211, 0.4);
  color: #9ec9ea;
}
.dark .auth-back-icon {
  background: rgba(79, 152, 211, 0.18);
  color: #8cbce4;
}

/* Background (mobile) */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79, 152, 211, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(88, 185, 157, 0.12), transparent 50%),
    linear-gradient(180deg, #f4f9fd 0%, #fafbfc 45%, #ffffff 100%);
}
.auth-bg-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(60px);
  pointer-events: none;
}
.auth-bg-blob-1 {
  width: 280px;
  height: 280px;
  top: -40px;
  right: -60px;
  background: rgba(79, 152, 211, 0.22);
}
.auth-bg-blob-2 {
  width: 200px;
  height: 200px;
  bottom: 20%;
  left: -50px;
  background: rgba(88, 185, 157, 0.16);
}

/* Brand panel (desktop) */
.auth-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #3d86c2 0%, #4f98d3 50%, #58b99d 100%);
  color: #fff;
}
.auth-panel::before {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  top: -140px;
  right: -100px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.auth-feature-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.auth-mascot {
  animation: auth-float 4s ease-in-out infinite;
}
@keyframes auth-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Mobile sheet / hero */
@media (max-width: 1023px) {
  .auth-header-inner {
    height: 56px;
    padding-top: env(safe-area-inset-top);
  }
  .auth-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 0;
    padding-bottom: 0;
  }
  .auth-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 24px 0;
  }
  .auth-hero-mascot {
    width: 88px;
    height: 88px;
    margin-bottom: -28px;
    z-index: 2;
  }
  .auth-hero-mascot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(79, 152, 211, 0.22));
  }
  .auth-sheet {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 28px;
    box-shadow: 0 12px 40px rgba(79, 152, 211, 0.12);
    padding: 40px 24px 28px;
    backdrop-filter: blur(16px);
    margin: 0 16px calc(16px + env(safe-area-inset-bottom));
  }
  .auth-intro {
    text-align: center;
  }
  .auth-intro h2 {
    font-size: 1.5rem;
  }
  .auth-intro p {
    margin-left: auto;
    margin-right: auto;
    max-width: 16rem;
  }
  .auth-form-wrap {
    width: 100%;
  }
  .auth-trust {
    margin-top: auto;
    padding-top: 28px;
  }
}

@media (min-width: 1024px) {
  .auth-hero {
    display: none;
  }
  .auth-sheet {
    display: contents;
  }
  .auth-bg {
    display: none;
  }
  .auth-form-wrap {
    max-width: 400px;
    margin: 0 auto;
  }
}

/* Form fields */
.auth-field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1c1e;
}
.auth-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(201, 211, 219, 0.75);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(26, 28, 30, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-field:hover {
  border-color: rgba(79, 152, 211, 0.45);
}
.auth-field:focus-within {
  border-color: #4f98d3;
  box-shadow: 0 0 0 4px rgba(79, 152, 211, 0.12);
}
.auth-field-icon {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
  color: #8894a0;
  pointer-events: none;
}
.auth-field:focus-within .auth-field-icon {
  color: #4f98d3;
}
.auth-field-license {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.auth-field-prefix {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #1a1c1e;
  user-select: none;
  pointer-events: none;
}
.auth-field input.auth-field-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: auto;
  margin: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  padding: 14px 0 !important;
  font-size: 15px;
  line-height: 1.4;
  color: #1a1c1e;
  box-shadow: none !important;
  outline: none;
}
.auth-field input.auth-field-input:focus {
  border: 0 !important;
  box-shadow: none !important;
}
.auth-field input.auth-field-input::placeholder {
  color: #a0adb8;
}
.auth-field-action {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-right: -4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8894a0;
  cursor: pointer;
  transition: color 0.2s ease;
}
.auth-field-action:hover {
  color: #4f98d3;
}

/* Actions */
.auth-submit {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 9999px;
  padding: 15px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #4f98d3 0%, #3d86c2 55%, #58b99d 100%);
  box-shadow: 0 10px 28px rgba(79, 152, 211, 0.28);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.auth-submit:hover {
  opacity: 0.95;
  box-shadow: 0 14px 32px rgba(79, 152, 211, 0.34);
}
.auth-submit:active {
  transform: scale(0.98);
}

.auth-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #4f98d3;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.auth-demo-btn:hover {
  opacity: 0.8;
}

/* Trust row */
.auth-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
}
.auth-trust span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7c8a;
}
.auth-trust .material-symbols-outlined {
  font-size: 15px;
  color: #58b99d;
}

/* Dark mode */
.dark .auth-bg {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79, 152, 211, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(88, 185, 157, 0.08), transparent 50%),
    linear-gradient(180deg, #071018 0%, #08131d 45%, #0a1622 100%);
}
.dark .auth-field-label,
.dark .text-on-surface {
  color: #e6edf3 !important;
}
.dark .text-on-surface-variant {
  color: #9fb1c2 !important;
}
.dark .auth-field {
  background: #0f1d2b;
  border-color: rgba(84, 108, 132, 0.55);
  box-shadow: none;
}
.dark .auth-field:hover {
  border-color: rgba(79, 152, 211, 0.5);
}
.dark .auth-field:focus-within {
  border-color: #4f98d3;
  box-shadow: 0 0 0 4px rgba(79, 152, 211, 0.16);
}
.dark .auth-field input.auth-field-input {
  background: transparent !important;
  color: #e6edf3;
}
.dark .auth-field input.auth-field-input::placeholder {
  color: #7f95aa;
}
.dark .auth-field-prefix {
  color: #e6edf3;
}
.dark .auth-field-icon,
.dark .auth-field-action {
  color: #7f95aa;
}
.dark .auth-field:focus-within .auth-field-icon {
  color: #9fc8e8;
}
.dark .auth-trust span {
  color: #8fa3b5;
}
.dark .auth-sheet {
  background: rgba(15, 29, 43, 0.94);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.28);
}
