/**
 * Nanban Public UX — user-friendly navigation, forms, mobile dock
 */

/* ═══ Hero contact rail — compact world-class ═══ */
#loginScreen .nb-hero-contact {
  margin: 0 0 0.5rem;
  width: 100%;
  max-width: 100%;
}

#loginScreen .nb-hero-contact-rail {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(13, 148, 136, 0.22);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}

#loginScreen .nb-hero-contact-kicker {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0d9488;
  white-space: nowrap;
}

#loginScreen .nb-hero-contact-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  text-decoration: none;
  color: #0f172a;
  white-space: nowrap;
  transition: color 0.15s ease;
}

#loginScreen .nb-hero-contact-item:hover {
  color: #0d9488;
}

#loginScreen .nb-hero-contact-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
}

#loginScreen .nb-hero-contact-item:hover .nb-hero-contact-name {
  color: #0f766e;
}

#loginScreen .nb-hero-contact-num {
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: #1d4ed8;
  font-feature-settings: "tnum" 1;
}

#loginScreen .nb-hero-contact-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
}

@media (max-width: 520px) {
  #loginScreen .nb-hero-contact-rail {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border-radius: 14px;
    padding: 8px 10px;
  }

  #loginScreen .nb-hero-contact-kicker {
    font-size: 0.58rem;
    margin-bottom: 2px;
  }

  #loginScreen .nb-hero-contact-dot {
    display: none;
  }

  #loginScreen .nb-hero-contact-item {
    justify-content: space-between;
    padding: 4px 6px;
    border-radius: 8px;
    background: rgba(240, 253, 250, 0.6);
  }

  #loginScreen .nb-hero-contact-num {
    font-size: 0.88rem;
  }
}

/* ═══ Footer — tight phone rows, no duplicate spacing ═══ */
#loginScreen.nb-ultra .nb-footer--premium.nb-footer--compact {
  background: linear-gradient(180deg, #ffffff 0%, #f7f5f2 100%) !important;
  padding: clamp(28px, 4vw, 44px) clamp(16px, 4vw, 32px) clamp(20px, 3vw, 28px) !important;
  text-align: left !important;
}

#publicPortal .nb-footer--compact {
  padding: clamp(28px, 4vw, 40px) clamp(16px, 4vw, 32px) clamp(20px, 3vw, 28px) !important;
}

#publicPortal .nb-footer--compact .nb-footer-grid {
  gap: clamp(16px, 3vw, 28px) !important;
  align-items: start;
}

#publicPortal .nb-footer--compact .nb-footer-grid h4 {
  margin: 0 0 8px !important;
  font-size: 10px !important;
  letter-spacing: 0.12em !important;
}

#publicPortal .nb-footer-phone-list,
#publicPortal .nb-footer-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#publicPortal .nb-footer-phone-list li,
#publicPortal .nb-footer-link-list li {
  margin: 0;
  padding: 0;
}

#publicPortal .nb-footer-phone-list li + li {
  margin-top: 4px;
}

#publicPortal .nb-footer-link-list li + li {
  margin-top: 6px;
}

#publicPortal .nb-footer-phone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: #f8fafc;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

#publicPortal .nb-footer-phone-row:hover {
  border-color: rgba(13, 148, 136, 0.35);
  background: #f0fdfa;
}

#publicPortal .nb-footer-phone-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
}

#publicPortal .nb-footer-phone-num {
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: #1d4ed8;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}

#publicPortal .nb-footer-link-list a {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569 !important;
  text-decoration: none;
  letter-spacing: 0 !important;
}

#publicPortal .nb-footer-link-list a:hover {
  color: #0d9488 !important;
}

#publicPortal .nb-footer-meta {
  margin: 0 0 4px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #64748b;
}

#publicPortal .nb-footer-copy {
  margin: 10px 0 0;
  font-size: 0.68rem;
  color: #94a3b8;
}

@media (max-width: 720px) {
  #publicPortal .nb-footer--compact .nb-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  #publicPortal .nb-footer-phone-row {
    padding: 10px 12px;
  }
}

/* Skip link */
.nb-skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100001;
  padding: 10px 16px;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  text-decoration: none;
}

.nb-skip-link:focus {
  left: 12px;
}

/* Mobile nav toggle */
#loginScreen .nb-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

#loginScreen .nb-nav-drawer-backdrop,
.nb-nav-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

#loginScreen .nb-nav-drawer-backdrop.is-open,
.nb-nav-drawer-backdrop.is-open {
  display: block;
}

#loginScreen .nb-nav-drawer,
.nb-nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 88vw);
  height: 100dvh;
  z-index: 10045;
  background: #fff;
  box-shadow: -8px 0 40px rgba(15, 23, 42, 0.12);
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  transition: right 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
}

#loginScreen .nb-nav-drawer.is-open,
.nb-nav-drawer.is-open {
  right: 0;
}

#loginScreen .nb-nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

#loginScreen .nb-nav-drawer-head strong {
  font-size: 0.95rem;
  color: #0f172a;
}

#loginScreen .nb-nav-drawer-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 20px;
  cursor: pointer;
}

#loginScreen .nb-nav-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#loginScreen .nb-nav-drawer-nav a,
#loginScreen .nb-nav-drawer-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #1e293b;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

#loginScreen .nb-nav-drawer-nav a:hover,
#loginScreen .nb-nav-drawer-nav button:hover {
  background: #f0fdfa;
  color: #0f766e;
}

#loginScreen .nb-nav-drawer-nav .nb-nav-drawer-primary {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff !important;
  font-weight: 800;
  margin-top: 8px;
}

#loginScreen .nb-nav-drawer-nav .nb-nav-drawer-divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 8px 0;
}

@media (max-width: 900px) {
  #loginScreen .nb-nav {
    flex-wrap: nowrap;
    gap: 8px;
  }

  #loginScreen .nb-nav-links {
    display: none !important;
  }

  #loginScreen .nb-nav-toggle {
    display: inline-flex !important;
  }

  #loginScreen .nb-nav-brand {
    min-width: 0;
    flex: 1;
  }

  #loginScreen .nb-nav-title .nb-nav-ta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Mobile bottom dock */
.nb-mobile-dock {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10030;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.08);
}

html.nb-public-dock-on .nb-mobile-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.nb-mobile-dock a,
.nb-mobile-dock button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 6px 4px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.nb-mobile-dock span:first-child {
  font-size: 20px;
  line-height: 1;
}

.nb-mobile-dock .nb-dock--wa {
  color: #059669;
}

.nb-mobile-dock .nb-dock--call {
  color: #2563eb;
}

.nb-mobile-dock .nb-dock--enq {
  color: #fff;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.nb-mobile-dock .nb-dock--quiz {
  color: #7c3aed;
}

html.nb-public-dock-on #publicPortal #loginScreen {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* WhatsApp float — desktop */
.nb-wa-float {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 10020;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nb-wa-float:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(37, 211, 102, 0.45);
  color: #fff;
}

@media (min-width: 901px) {
  html.nb-public-portal-active .nb-wa-float {
    display: inline-flex;
  }
}

/* Back to top */
.nb-back-top {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 10019;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 50%;
  background: #fff;
  color: #0f172a;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.nb-back-top.is-visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 901px) {
  .nb-back-top.is-visible {
    bottom: 24px;
  }
}

/* How it works */
.nb-how-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) clamp(24px, 4vw, 40px);
}

@media (min-width: 640px) {
  .nb-how-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

.nb-how-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.nb-how-step__num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nb-how-step h3 {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}

.nb-how-step p {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}

/* FAQ */
.nb-faq-section {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 48px) clamp(16px, 4vw, 24px);
}

.nb-faq-section h2 {
  text-align: center;
  margin: 0 0 20px;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 800;
  color: #0f172a;
}

.nb-faq-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff;
  overflow: hidden;
}

.nb-faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  text-align: left;
  cursor: pointer;
}

.nb-faq-q::after {
  content: "+";
  font-size: 1.2rem;
  color: #0d9488;
  flex-shrink: 0;
}

.nb-faq-item.is-open .nb-faq-q::after {
  content: "−";
}

.nb-faq-a {
  display: none;
  padding: 0 16px 14px;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.55;
}

.nb-faq-item.is-open .nb-faq-a {
  display: block;
}

/* Enquiry form — accessible labels */
.nb-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nb-field label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.nb-field input,
.nb-field select,
.nb-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  font-family: inherit;
  font-size: 16px;
  background: #fff;
  color: #0f172a;
}

.nb-field textarea {
  min-height: 88px;
  resize: vertical;
}

.nb-field input:focus,
.nb-field select:focus,
.nb-field textarea:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.nb-field--optional label::after {
  content: " (optional)";
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: #94a3b8;
}

#landingEnqStatus.nb-enquiry-ok {
  color: #059669 !important;
  font-weight: 700;
}

#landingEnqStatus.nb-enquiry-err {
  color: #dc2626 !important;
  font-weight: 700;
}

/* Hero — hide extra login buttons on small screens (in drawer) */
@media (max-width: 640px) {
  #loginScreen .nb-hero-cta .nb-btn-outline:nth-child(3),
  #loginScreen .nb-hero-cta .nb-btn-outline:nth-child(4) {
    display: none !important;
  }
}

#loginScreen .nb-hero-login-hint {
  display: none;
  margin-top: 8px;
  font-size: 0.72rem;
  color: #64748b;
  text-align: center;
}

@media (max-width: 640px) {
  #loginScreen .nb-hero-login-hint {
    display: block;
  }

  #loginScreen .nb-hero-login-hint button {
    border: none;
    background: none;
    color: #0d9488;
    font-weight: 800;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    text-decoration: underline;
  }
}

/* Enquiry focus highlight */
#saas-enquiry.is-focus {
  outline: 3px solid rgba(13, 148, 136, 0.35);
  outline-offset: 4px;
  border-radius: 16px;
}

/* Anchor scroll offset for fixed nav */
html {
  scroll-padding-top: 72px;
}

/* Hide public chrome when staff/student logged in */
html.nanban-authed .nb-mobile-dock,
html.nanban-authed .nb-wa-float,
html.nanban-authed .nb-back-top,
html.nanban-authed #nbNavDrawer,
html.nanban-authed #nbNavDrawerBackdrop,
html.nanban-authed #nbNavToggle,
html.nanban-pro-app.nanban-authed .nb-mobile-dock,
html.nanban-pro-app.nanban-authed .nb-wa-float,
html.nanban-pro-app.nanban-authed .nb-back-top,
html.nanban-pro-app.nanban-authed #nbNavDrawer,
html.nanban-pro-app.nanban-authed #nbNavDrawerBackdrop,
html.nanban-pro-app.nanban-authed #nbNavToggle {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.nanban-authed.nb-public-dock-on #publicPortal #loginScreen {
  padding-bottom: 0 !important;
}

body.nb-mobile-nav-open {
  overflow: hidden;
}
