/* ieGlobal Sales Intelligence — PIN login (charcoal shell + green accent) */

:root {
  color-scheme: dark;
  --bg: #121214;
  --bg-deep: #09090b;
  --bg-elevated: #1a1a1e;
  --text: #f5f5f7;
  --text-muted: rgba(200, 210, 205, 0.72);
  --accent: #00c853;
  --accent-alt: #10b981;
  --accent-press: #00e676;
  --accent-dim: rgba(0, 200, 83, 0.22);
  --accent-soft: rgba(16, 185, 129, 0.12);
  --error: #ff453a;
  --error-dim: rgba(255, 69, 58, 0.22);
  --ok: #00c853;
  --radius: 16px;
  --radius-sm: 12px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.si-auth,
.si-auth--welcome {
  position: relative;
  width: 100%;
  max-width: min(640px, 92vw);
  margin-inline: auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(14px, 2.4vh, 28px);
  padding: clamp(16px, 4vh, 40px) max(16px, env(safe-area-inset-left, 0px))
    clamp(20px, 6vh, 48px) max(16px, env(safe-area-inset-right, 0px));
  overflow-x: hidden;
  color: var(--text);
  background: transparent;
  z-index: 1;
}

/* Fixed charcoal shell + subtle green atmosphere (dashboard system colours) */
.si-auth-bg.si-auth-sky--charcoal,
.si-auth-sky--charcoal {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 45% at 72% 18%, rgba(16, 185, 129, 0.11) 0%, transparent 58%),
    radial-gradient(ellipse 50% 40% at 18% 78%, rgba(0, 200, 83, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 70% 55% at 50% 48%, rgba(26, 26, 30, 0.55) 0%, transparent 62%),
    linear-gradient(165deg, #161618 0%, #121214 42%, #0c0c0e 100%);
}

.si-auth-sky--charcoal::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 42% 36% at 50% 32%, rgba(0, 200, 83, 0.09) 0%, transparent 70%);
  opacity: 0.85;
}

.si-auth-sky--charcoal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(9, 9, 11, 0.35) 0%,
    rgba(18, 18, 20, 0.08) 38%,
    rgba(18, 18, 20, 0.12) 62%,
    rgba(9, 9, 11, 0.55) 100%
  );
}

/* Legacy globe class kept inert if markup ever references it */
.si-auth-sky--globe,
.si-auth-globe-bg {
  display: none !important;
}

.si-auth-hero,
.si-auth-body {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
}

.si-auth-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.8vh, 18px);
  flex: 0 0 auto;
  text-align: center;
}

.si-auth-logo-wrap {
  display: flex;
  justify-content: center;
  padding: 0;
}

.si-auth-logo {
  width: clamp(180px, 22vw + 8vh, 280px);
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 200, 83, 0.14));
}

.si-auth-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1vh, 12px);
  width: 100%;
}

.si-auth-welcome-title {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.18;
  font-size: clamp(1.45rem, 1.1rem + 2vw, 2.2rem);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.4);
}

.si-auth-welcome-line {
  display: block;
  color: #fff;
}

.si-auth-welcome-brand {
  display: block;
  margin-top: 2px;
  color: #fff;
}

.si-auth-welcome-accent {
  color: var(--accent);
}

.si-auth-welcome-sub {
  margin: 0 auto;
  max-width: min(34rem, 94%);
  font-size: clamp(1rem, 1.1vw + 0.82rem, 1.22rem);
  line-height: 1.45;
  color: rgba(200, 230, 210, 0.9);
  opacity: 0.92;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5), 0 0 2px rgba(0, 0, 0, 0.35);
}

.si-auth-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}

.si-auth-card.si-auth-glass {
  width: 100%;
  padding: 16px 16px 14px;
  border-radius: var(--radius);
  background:
    linear-gradient(165deg, rgba(30, 30, 34, 0.88) 0%, rgba(18, 18, 20, 0.94) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(16, 185, 129, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px) saturate(1.15);
  -webkit-backdrop-filter: blur(28px) saturate(1.15);
  flex: 0 0 auto;
  align-self: stretch;
  overflow: hidden;
}

.si-auth-title {
  margin: 0 0 12px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  text-align: center;
}

.si-auth-pin-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.si-auth-pin-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
}

.si-auth-digit {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  min-width: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  text-align: center;
  text-align-last: center;
  line-height: 56px;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0;
  border: 1px solid rgba(120, 220, 160, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  caret-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  -webkit-text-security: disc;
  text-security: disc;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}

.si-auth-digit:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: rgba(0, 200, 83, 0.08);
}

.si-auth-digit.is-filled-ok {
  border-color: var(--ok);
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.28);
  background: rgba(0, 200, 83, 0.12);
}

.si-auth-digit.is-filled-ok:focus {
  border-color: var(--ok);
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.36);
}

.si-auth-digit.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-dim);
  background: rgba(255, 69, 58, 0.1);
}

.si-auth-digit.error:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.3);
}

.si-auth-msg {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.88rem;
  text-align: center;
  color: var(--error);
  width: 100%;
}

.si-auth-msg:empty {
  display: none;
}

.si-auth-actions {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
}

.si-auth-cta {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid color-mix(in srgb, var(--accent) 72%, #000 28%);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff 12%), var(--accent) 52%);
  color: #0a0a0a;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow:
    0 8px 22px rgba(0, 160, 70, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: background 0.15s var(--ease), transform 0.12s var(--ease), opacity 0.15s var(--ease);
}

.si-auth-cta:hover:not(:disabled) {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-press) 86%, #fff 14%), var(--accent-press) 52%);
}

.si-auth-cta:active:not(:disabled) {
  transform: translateY(1px);
}

.si-auth-cta:disabled {
  opacity: 0.62;
  cursor: wait;
}

.si-auth-foot {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.si-auth-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.72rem;
  color: rgba(160, 200, 180, 0.65);
}

.si-auth-secure svg {
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.9;
}

.si-auth-help {
  margin-top: auto;
  margin-inline: auto;
  padding: 12px 12px max(8px, env(safe-area-inset-bottom, 0px));
  max-width: min(420px, 100%);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  flex: 0 0 auto;
}

.si-auth-help-text {
  margin: 0;
  font-size: clamp(0.82rem, 0.25vw + 0.76rem, 0.92rem);
  color: rgba(200, 220, 210, 0.78);
  line-height: 1.35;
}

.si-auth-help-text a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.si-auth-help-text a:hover,
.si-auth-help-text a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.si-auth-contact-icons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.si-auth-contact-ico {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: rgba(200, 220, 210, 0.88);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.si-auth-contact-ico:hover,
.si-auth-contact-ico:focus-visible {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.si-auth-contact-ico:active {
  transform: scale(0.96);
}

.si-auth-contact-ico-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.82;
}

@media (min-width: 1100px) {
  .si-auth-hero,
  .si-auth-body {
    max-width: 460px;
  }

  .si-auth-digit {
    width: 60px;
    height: 60px;
    line-height: 60px;
    font-size: 1.4rem;
  }
}

@media (orientation: landscape) and (max-height: 720px) {
  .si-auth--welcome {
    padding-top: max(6px, env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }

  .si-auth-welcome-title {
    font-size: clamp(1.28rem, 2.8vh, 1.7rem);
  }

  .si-auth-logo {
    width: clamp(140px, 18vw + 4vh, 200px);
  }
}
