/* Shared styling for the auth pages (login.php + register.php).
   Both render the same globe backdrop and floating form card; only the
   contents of .form-container differ. */

:root {
  --navy: #040e1f;
  --navy-mid: #081a36;
  --blue-deep: #0d4a9c;
  --blue: #135ab8;
  --blue-bright: #2f7dd6;
  --cyan: #7dd3fc;
  --teal: #22d3ee;
  --blue-light: #eef4ff;
  --blue-soft: #dce8ff;
  --white: #ffffff;
  --ink: #0b1830;
  --muted: #5b6b82;
  --border: #dfe9fa;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --elastic: cubic-bezier(.34, 1.56, .64, 1);
  --green: #22c58b;
  --green-deep: #0e9e6c;
  --amber: #f59e0b;
  --red: #ef4444;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--navy);
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  font-family: 'Space Grotesk', sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

@media(prefers-reduced-motion:reduce) {
  * {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ══ LAYOUT ══ */
.page {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ══ GLOBE PANEL — now the full-bleed background ══ */
.globe-panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

#globeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#globeCanvas:active {
  cursor: grabbing;
}

.globe-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.logo-img {
  height: 34px;
  width: auto;
  filter: brightness(0) invert(1);
}

.globe-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 40px 32px;
  z-index: 10;
  background: linear-gradient(transparent, rgba(4, 14, 31, .9) 50%);
}

@media(max-width:900px) {
  .globe-overlay {
    padding: 0 20px 16px;
  }
}

/* The scrim stays full width, but the words sit under the globe rather than
   off in the corner. auth-shell.js publishes the globe's left edge as
   --globe-left on every resize, and the caption starts from there. */
.globe-caption {
  width: min(560px, 100%);
  margin-left: max(0px, var(--globe-left, 0px));
}

.globe-headline {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: #fff;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 12px;
  max-width: 480px;
}

.globe-headline .accent {
  color: var(--cyan);
}

.globe-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.gs {
  display: flex;
  flex-direction: column;
}

.gs-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.gs-label {
  font-size: .68rem;
  color: rgba(255, 255, 255, .4);
  font-weight: 500;
}

.port-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: rgba(4, 14, 31, .88);
  border: 1px solid rgba(47, 125, 214, .3);
  border-radius: 8px;
  padding: 5px 11px;
  font-size: .7rem;
  font-weight: 600;
  color: var(--cyan);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .2s;
  white-space: nowrap;
  font-family: 'Space Grotesk', sans-serif;
}

.port-tooltip.visible {
  opacity: 1;
}

.user-pin-label {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: var(--green-deep);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  font-family: 'Space Grotesk', sans-serif;
  opacity: 0;
  transform: translateY(10px) scale(.8);
  transition: all .4s var(--elastic);
  box-shadow: 0 4px 16px rgba(14, 158, 108, .4);
}

.user-pin-label.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.user-pin-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--green-deep);
}

/* ══ FORM PANEL — floating card over the globe background ══ */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateY(14px) scale(.98);
  }

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

.form-panel {
  position: absolute;
  top: 50%;
  right: 56px;
  transform: translateY(-50%);
  width: 520px;
  max-height: 90vh;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 40px 90px -12px rgba(2, 10, 26, .55), 0 12px 32px -8px rgba(2, 10, 26, .35), 0 0 0 1px rgba(13, 74, 156, .06), inset 0 1px 0 rgba(255, 255, 255, .9);
  display: flex;
  flex-direction: column;
  z-index: 5;
  overflow: hidden;
  animation: cardIn .6s var(--ease) .1s both;
}

@media(max-width:1080px) {
  .form-panel {
    width: 480px;
    right: 36px;
  }
}

@media(max-width:900px) {
  .form-panel {
    position: absolute;
    left: 50%;
    right: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 92vw;
    max-width: 440px;
    max-height: 88vh;
  }

  @keyframes cardIn {
    from {
      opacity: 0;
      transform: translate(-50%, -50%) translateY(14px) scale(.98);
    }

    to {
      opacity: 1;
      transform: translate(-50%, -50%) translateY(0) scale(1);
    }
  }
}

@media(max-width:500px) {
  .form-panel {
    width: 94vw;
    border-radius: 18px;
  }
}

.form-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 30px 32px 32px;
  overflow-y: auto;
}

@media(max-width:500px) {
  .form-scroll {
    padding: 20px 20px 26px;
  }
}

.form-container {
  width: 100%;
  max-width: 440px;
  /* Centres the card while it is shorter than the panel, and — unlike
     align-items/justify-content on .form-scroll — leaves the overflow
     reachable once it is taller, so the first field is not clipped
     behind the logo bar on the long register form. */
  margin: auto;
}

.form-logo {
  flex-shrink: 0;
  text-align: center;
  padding: 26px 32px 12px;
  box-shadow: 0 12px 16px -8px rgba(20, 40, 80, .06);
  position: relative;
  z-index: 3;
}

.form-logo img {
  height: 36px;
  width: auto;
}

/* Steps */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 26px;
}

.sdot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .76rem;
  font-weight: 700;
  color: var(--muted);
  background: #fff;
  z-index: 1;
  transition: all .35s var(--ease);
  flex-shrink: 0;
}

.sdot.active {
  border-color: var(--blue-deep);
  background: var(--blue-deep);
  color: #fff;
  transform: scale(1.1);
}

.sdot.done {
  border-color: var(--green);
  background: var(--green-deep);
  color: #fff;
}

.sline {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 -2px;
  transition: background .4s ease;
}

.sline.done {
  background: var(--green);
}

.ftitle {
  font-size: 1.35rem;
  color: var(--navy-mid);
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.2;
}

.fsub {
  color: var(--muted);
  font-size: .86rem;
  margin-bottom: 24px;
}

#registerView .ftitle {
  font-size: 1.6rem;
  text-align: center;
}

#registerView .fsub {
  text-align: center;
}

.fstep {
  display: none;
  animation: stepSlide .4s var(--elastic);
}

.fstep.active {
  display: block;
}

@keyframes stepSlide {
  from {
    opacity: 0;
    transform: translateX(24px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.fg {
  margin-bottom: 14px;
}

.fg label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--navy-mid);
  margin-bottom: 6px;
}

.fg label .req {
  color: var(--red);
  margin-left: 2px;
}

.fg input,
.fg select {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid #e4ebf5;
  border-radius: 11px;
  font-size: .92rem;
  font-family: inherit;
  color: var(--ink);
  background: #fbfcfe;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.fg input:focus,
.fg select:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(47, 125, 214, .1);
  background: #fff;
}

.fg input.err {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .08);
}

.fg .fe {
  font-size: .72rem;
  color: var(--red);
  font-weight: 600;
  margin-top: 3px;
  min-height: 0;
}

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fef2f2;
  border: 1.5px solid rgba(239, 68, 68, .3);
  border-radius: 11px;
  padding: 11px 14px;
  margin-bottom: 14px;
  font-size: .82rem;
  font-weight: 600;
  color: #b91c1c;
}

.form-alert--success {
  background: #f0fdf4;
  border-color: rgba(34, 197, 94, .3);
  color: #15803d;
}

.form-alert--warning {
  background: #fffbeb;
  border-color: rgba(245, 158, 11, .35);
  color: #b45309;
}

.form-alert span {
  flex: 1;
}

.form-alert-x {
  flex: none;
  background: none;
  border: 0;
  padding: 0;
  margin-top: -2px;
  font-size: 1.15rem;
  line-height: 1;
  color: inherit;
  opacity: .55;
  cursor: pointer;
}

.form-alert-x:hover {
  opacity: 1;
}

.fg select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235b6b82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.frow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media(max-width:500px) {
  .frow {
    grid-template-columns: 1fr;
  }
}

.pw-wrap {
  position: relative;
}

.pw-wrap input {
  padding-right: 42px;
}

.pw-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px;
  display: flex;
}

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

.pw-bar-row {
  display: flex;
  gap: 3px;
  margin-top: 6px;
}

.pw-b {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: background .3s;
}

.pw-b.w {
  background: var(--red);
}

.pw-b.m {
  background: var(--amber);
}

.pw-b.s {
  background: var(--green);
}

.pw-hint {
  font-size: .7rem;
  font-weight: 600;
  margin-top: 3px;
  min-height: 14px;
}

.chk {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 18px 0 4px;
}

.chk input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--border);
  appearance: none;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}

.chk input:checked {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

.chk input:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
}

.chk label {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.5;
  cursor: pointer;
}

.chk label a {
  color: var(--blue-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.btn-next,
.btn-go {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: .94rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all .25s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn-next {
  background: var(--blue-deep);
  color: #fff;
  box-shadow: 0 6px 18px rgba(11, 61, 145, .25);
}

.btn-next:hover {
  background: var(--navy-mid);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(11, 61, 145, .35);
}

.btn-back {
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .94rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  background: #fff;
  color: var(--navy-mid);
  transition: all .25s var(--ease);
}

.btn-back:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}

.btn-go {
  background: var(--green-deep);
  color: #fff;
  box-shadow: 0 6px 18px rgba(14, 158, 108, .3);
}

.btn-go:hover {
  background: #0b8a5e;
  transform: translateY(-2px);
}

.btn-go:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.btn-go .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}

.btn-go.loading .blbl {
  visibility: hidden;
}

.btn-go.loading .spinner {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}

.or-line::before,
.or-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.or-line span {
  font-size: .74rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.signin-link {
  text-align: center;
  font-size: .86rem;
  color: var(--muted);
  margin-top: 16px;
}

.signin-link a {
  color: var(--blue-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.success-view {
  display: none;
  text-align: center;
  padding: 20px 0;
}

.success-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--green-deep);
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ringIn .5s var(--elastic);
  box-shadow: 0 10px 30px rgba(14, 158, 108, .3);
}

@keyframes ringIn {
  from {
    transform: scale(0) rotate(-25deg);
    opacity: 0;
  }

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

.success-ring svg {
  width: 36px;
  height: 36px;
  color: #fff;
}

.chk-path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: drawChk .5s ease .35s forwards;
}

@keyframes drawChk {
  to {
    stroke-dashoffset: 0;
  }
}

.success-view h2 {
  font-size: 1.4rem;
  color: var(--navy-mid);
  margin-bottom: 8px;
}

.success-view p {
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 26px;
  line-height: 1.55;
}

.btn-dash {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .94rem;
  font-family: 'Space Grotesk', sans-serif;
  background: var(--blue-deep);
  color: #fff;
  box-shadow: 0 8px 20px rgba(11, 61, 145, .25);
  transition: all .25s var(--ease);
}

.btn-dash:hover {
  background: var(--navy-mid);
  transform: translateY(-2px);
}

.form-foot {
  padding: 14px 36px;
  border-top: 1px solid rgba(223, 233, 250, .7);
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  flex-shrink: 0;
  background: rgba(248, 251, 255, .6);
}

.form-foot a {
  color: var(--blue-deep);
  font-weight: 600;
}

/* ══ AUTH VIEWS (login / register) ══ */
.btn-primary {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all .25s var(--ease);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue-deep), #4f6ee0);
  color: #fff;
  box-shadow: 0 10px 24px rgba(11, 61, 145, .3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(11, 61, 145, .4);
}

.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}

.btn-primary.loading .blbl {
  visibility: hidden;
}

.btn-primary.loading .spinner {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.btn-outline {
  width: 100%;
  padding: 14px 20px;
  border: 1.5px solid var(--blue-deep);
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  background: #fff;
  color: var(--blue-deep);
  transition: all .25s var(--ease);
}

.btn-outline:hover {
  background: var(--blue-light);
}

.btn-row .btn-primary,
.btn-row .btn-outline {
  flex: 1;
  width: auto;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2px 0 20px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.remember input[type="checkbox"] {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 2px solid var(--border);
  appearance: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all .2s;
}

.remember input:checked {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

.remember input:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
}

.forgot-link {
  font-size: .82rem;
  color: var(--blue-deep);
  font-weight: 700;
}

.forgot-link:hover {
  text-decoration: underline;
}

.frow3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media(max-width:500px) {
  .frow3 {
    grid-template-columns: 1fr;
  }
}

.phone-group {
  display: flex;
  gap: 8px;
}

.phone-group select {
  /* Wide enough for "+91 India" when there is room, but it gives space back
     to the number field rather than squeezing it out on a narrow card. */
  flex: 0 1 118px;
  min-width: 86px;
  font-size: .84rem;
  padding-left: 11px;
  padding-right: 24px;
  background-position: right 8px center;
}

.phone-group input {
  flex: 1 1 96px;
  min-width: 0;
}

/* Links styled as buttons — the cross-page login ⇄ register CTAs. */
a.btn-primary,
a.btn-outline,
a.btn-next,
a.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}
