/* TOUR-OPS Login — dedicated page styles (prototype UI only) */
:root {
  --login-teal: #0d9488;
  --login-teal-deep: #0b6e68;
  --login-teal-mid: #0f9f95;
  --login-teal-soft: #e6f7f5;
  --login-ink: #15202b;
  --login-muted: #6b7380;
  --login-border: #e2e8ef;
  --login-surface: #ffffff;
  --login-page-bg: #f4f6f8;
  --login-radius-card: 16px;
  --login-radius-ctl: 10px;
  --login-hero-image: url("../img/login/hero.svg");
}

body.login-view {
  overflow: auto;
  background: var(--login-page-bg);
}

body.login-view .app-sidebar,
body.login-view .topbar,
body.login-view .context-bar,
body.login-view .bottom-nav,
body.login-view .nav-backdrop,
body.login-view .proto-sheet,
body.login-view .proto-backdrop,
body.login-view .chip-env,
body.login-view .dirty-pill {
  display: none !important;
}

body.login-view .app-shell {
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
}

body.login-view .app-main {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

body.login-view .workspace {
  padding: 0;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: none;
  overflow: auto;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font, "Noto Sans Thai", "Noto Sans", "Segoe UI", sans-serif);
  color: var(--login-ink);
}

.login-split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ——— Hero / brand panel ——— */
.login-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(165deg, rgba(8, 45, 48, 0.55) 0%, rgba(11, 90, 92, 0.35) 42%, rgba(6, 40, 48, 0.72) 100%),
    var(--login-hero-image) center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 40px 28px;
}

.login-hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
}

.login-mark svg {
  width: 30px;
  height: 30px;
  display: block;
}

.login-brand-text strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.login-brand-text span {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  opacity: 0.9;
}

.login-hero-copy {
  max-width: 28rem;
  margin: 48px 0 auto;
}

.login-hero-copy h1 {
  margin: 0;
  font-size: clamp(1.85rem, 2.6vw, 2.55rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.login-hero-rule {
  width: 48px;
  height: 3px;
  margin: 16px 0 14px;
  border-radius: 99px;
  background: var(--login-teal-mid);
}

.login-hero-copy p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.45;
  opacity: 0.92;
  max-width: 24rem;
}

.login-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
  margin: 28px 0 20px;
  padding: 16px 14px;
  border-radius: 12px;
  background: rgba(6, 30, 36, 0.38);
  backdrop-filter: blur(6px);
}

.login-feature {
  min-width: 0;
}

.login-feature-ico {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  color: #9fe3dc;
}

.login-feature-ico svg {
  width: 100%;
  height: 100%;
  display: block;
}

.login-feature strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-feature span {
  display: block;
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0.88;
}

.login-trust {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.75rem;
  line-height: 1.4;
  opacity: 0.92;
}

.login-trust svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
}

/* ——— Form panel ——— */
.login-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 28px 24px;
  background:
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(13, 148, 136, 0.06), transparent 55%),
    var(--login-page-bg);
}

.login-lang {
  position: absolute;
  top: 20px;
  right: 24px;
}

.login-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--login-border);
  border-radius: 999px;
  background: #fff;
  color: var(--login-ink);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.login-lang-btn:hover,
.login-lang-btn:focus-visible {
  border-color: var(--login-teal);
  outline: 2px solid rgba(13, 148, 136, 0.25);
  outline-offset: 1px;
}

.login-lang-btn svg {
  width: 16px;
  height: 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--login-surface);
  border-radius: var(--login-radius-card);
  box-shadow: 0 12px 40px rgba(21, 32, 43, 0.08);
  border: 1px solid rgba(226, 232, 239, 0.9);
  padding: 28px 28px 22px;
}

.login-welcome {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--login-teal-soft);
  color: var(--login-teal-deep);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--login-ink);
}

.login-card-lead {
  margin: 0 0 22px;
  font-size: 0.875rem;
  color: var(--login-muted);
  line-height: 1.4;
}

.login-field {
  margin-bottom: 14px;
}

.login-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--login-ink);
}

.login-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--login-border);
  border-radius: var(--login-radius-ctl);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input-wrap:focus-within {
  border-color: var(--login-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.login-input-wrap.is-invalid {
  border-color: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12);
}

.login-input-wrap .login-ico {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #8a93a0;
}

.login-input-wrap input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--login-ink);
  outline: none;
  padding: 10px 0;
}

.login-input-wrap input::placeholder {
  color: #9aa3af;
}

.login-toggle-pw {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: -4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7380;
  cursor: pointer;
}

.login-toggle-pw:hover,
.login-toggle-pw:focus-visible {
  background: #f3f5f8;
  color: var(--login-teal-deep);
  outline: none;
}

.login-toggle-pw svg {
  width: 18px;
  height: 18px;
}

.login-error {
  display: none;
  margin: -4px 0 10px;
  font-size: 0.75rem;
  color: #c62828;
}

.login-error.is-visible {
  display: block;
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  border: 0;
  border-radius: var(--login-radius-ctl);
  background: linear-gradient(90deg, var(--login-teal-mid) 0%, var(--login-teal-deep) 100%);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(11, 110, 104, 0.28);
}

.login-submit:hover {
  filter: brightness(1.04);
}

.login-submit:focus-visible {
  outline: 2px solid var(--login-teal);
  outline-offset: 2px;
}

.login-submit:active {
  transform: translateY(1px);
}

.login-submit.is-loading {
  opacity: 0.85;
  pointer-events: none;
}

.login-submit svg {
  width: 18px;
  height: 18px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: #98a0ab;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--login-border);
}

.login-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--login-border);
  border-radius: var(--login-radius-ctl);
  background: #fff;
  color: var(--login-ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.login-social-btn:hover,
.login-social-btn:focus-visible {
  border-color: #c5ced9;
  background: #fafbfc;
  outline: 2px solid rgba(13, 148, 136, 0.2);
  outline-offset: 1px;
}

.login-social-btn svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.login-card-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 0;
  font-size: 0.72rem;
  color: var(--login-muted);
}

.login-card-secure svg {
  width: 14px;
  height: 14px;
  color: var(--login-teal);
}

.login-footer {
  margin-top: 22px;
  font-size: 0.75rem;
  color: #8b949e;
  text-align: center;
}

/* ——— Mobile ——— */
@media (max-width: 900px) {
  .login-split {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 0;
    padding: 20px 18px 18px;
    background:
      linear-gradient(180deg, rgba(8, 45, 48, 0.5) 0%, rgba(11, 90, 92, 0.45) 55%, rgba(6, 40, 48, 0.78) 100%),
      var(--login-hero-image) center 30% / cover no-repeat;
  }

  .login-hero-copy,
  .login-features,
  .login-trust {
    display: none;
  }

  .login-hero-brand {
    gap: 10px;
  }

  .login-mark {
    width: 42px;
    height: 42px;
  }

  .login-brand-text strong {
    font-size: 1.15rem;
  }

  .login-main {
    padding: 20px 16px 28px;
    justify-content: flex-start;
  }

  .login-lang {
    position: static;
    align-self: flex-end;
    margin: 0 0 14px;
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  .login-card {
    max-width: none;
    padding: 22px 18px 18px;
  }

  .login-submit,
  .login-social-btn,
  .login-input-wrap {
    min-height: 48px;
  }

  .login-toggle-pw {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 900px), (html.force-mobile) {
  body.login-view.force-mobile-login .login-hero-copy,
  html.force-mobile body.login-view .login-hero-copy,
  html.force-mobile body.login-view .login-features,
  html.force-mobile body.login-view .login-trust {
    display: none;
  }
}

html.force-mobile body.login-view .login-split {
  grid-template-columns: 1fr;
}

html.force-mobile body.login-view .login-hero {
  padding: 20px 18px;
}

html.force-mobile body.login-view .login-main {
  padding: 20px 16px 28px;
  justify-content: flex-start;
}

html.force-mobile body.login-view .login-lang {
  position: static;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

html.force-mobile body.login-view .login-card {
  max-width: none;
}
