/* Admin auth — split login (Analyse360 branding) */
:root {
  --adm-ink: #001038;
  --adm-paper: #f7faff;
  --adm-accent: #0060f8;
  --adm-accent-deep: #0047c2;
  --adm-muted: #5f6e88;
  --adm-field: #eef4ff;
  --adm-border: #00103814;
  --adm-font-display: "Fraunces", Georgia, serif;
  --adm-font-body: "Manrope", system-ui, sans-serif;
  --adm-font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

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

body.admin-auth {
  font-family: var(--adm-font-body);
  color: var(--adm-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

.adm-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100dvh;
}

/* —— Left brand panel —— */
.adm-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 56px);
  color: #fff;
  background: var(--adm-ink);
}

.adm-brand-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.adm-brand-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
}

.adm-brand-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(155deg, #000820e6 0%, #001038b8 42%, #0047c299 100%);
}

.adm-brand-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(#ffffff12 1px, transparent 1px),
    linear-gradient(90deg, #ffffff12 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 30% 40%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse 90% 80% at 30% 40%, #000 10%, transparent 72%);
}

.adm-brand-orb {
  position: absolute;
  width: min(52vw, 520px);
  height: min(52vw, 520px);
  top: -14%;
  right: -18%;
  z-index: 1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, #0060f842, transparent 68%);
  filter: blur(48px);
}

.adm-brand-copy {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  margin-top: auto;
}

.adm-brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font-family: var(--adm-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffffd9;
}

.adm-brand-kicker::before {
  content: "";
  width: 3px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #4da3ff, var(--adm-accent));
}

.adm-brand-title {
  margin: 0;
  font-family: var(--adm-font-display);
  font-size: clamp(2rem, 4.2vw, 3.35rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.adm-brand-quote {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 30rem;
  font-family: var(--adm-font-display);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.55;
  color: #ffffffbf;
}

/* —— Right auth panel —— */
.adm-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 64px);
  background: #fff;
}

.adm-panel-inner {
  width: min(100%, 420px);
  margin-inline: auto;
}

.adm-logo {
  display: block;
  width: min(100%, 180px);
  height: auto;
  margin: 0 0 36px;
}

.adm-head h1 {
  margin: 0 0 8px;
  font-family: var(--adm-font-display);
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--adm-ink);
}

.adm-head p {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--adm-muted);
}

.adm-view[hidden] {
  display: none !important;
}

.adm-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.adm-field label {
  font-family: var(--adm-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--adm-muted);
}

.adm-input-wrap {
  position: relative;
}

.adm-input-wrap iconify-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--adm-muted);
  pointer-events: none;
}

.adm-input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--adm-field);
  font: inherit;
  font-size: 15px;
  color: var(--adm-ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.adm-input::placeholder {
  color: #5f6e8899;
}

.adm-input:hover {
  background: #e8f1ff;
}

.adm-input:focus {
  outline: none;
  border-color: #0060f84d;
  background: #fff;
  box-shadow: 0 0 0 4px #0060f81f;
}

.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 15px 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--adm-accent) 0%, var(--adm-accent-deep) 100%);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.adm-btn:hover:not(:disabled) {
  box-shadow: 0 12px 28px #0060f842;
  transform: translateY(-1px);
}

.adm-btn:active:not(:disabled) {
  transform: translateY(0);
}

.adm-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.adm-btn-ghost {
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--adm-ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.adm-btn-ghost:hover {
  color: var(--adm-accent);
}

.adm-links {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.adm-links button {
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--adm-ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.adm-links button:hover {
  color: var(--adm-accent);
}

.adm-links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--adm-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.adm-links a:hover {
  color: var(--adm-accent);
}

.adm-alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.adm-alert[hidden] {
  display: none !important;
}

.adm-alert.is-err {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.adm-alert.is-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.adm-foot {
  margin-top: auto;
  padding-top: 40px;
  font-family: var(--adm-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5f6e8888;
  text-align: center;
}

/* —— Unauthorized modal —— */
.adm-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.adm-modal[hidden] {
  display: none !important;
}

.adm-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: #00103866;
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.adm-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 28px 24px 24px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--adm-border);
  box-shadow: 0 24px 64px #0010382e;
  text-align: center;
}

.adm-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: #fff1f2;
  color: #be123c;
}

.adm-modal-icon iconify-icon {
  width: 28px;
  height: 28px;
}

.adm-modal-title {
  margin: 0 0 10px;
  font-family: var(--adm-font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--adm-ink);
}

.adm-modal-text {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--adm-muted);
}

.adm-modal-btn {
  width: 100%;
  margin: 0;
}

body.admin-auth.adm-modal-open {
  overflow: hidden;
}

.adm-panel .adm-foot {
  width: min(100%, 420px);
  margin-inline: auto;
  margin-top: 48px;
}

@media (max-width: 960px) {
  .adm-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100dvh;
  }

  .adm-brand {
    min-height: 0;
    max-height: 220px;
    justify-content: flex-end;
    padding: 20px 20px 22px;
  }

  .adm-brand-bg img {
    object-position: center 28%;
  }

  .adm-brand-orb {
    width: 220px;
    height: 220px;
    top: -30%;
    right: -20%;
  }

  .adm-brand-copy {
    margin-top: 0;
    max-width: none;
  }

  .adm-brand-kicker {
    margin-bottom: 10px;
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  .adm-brand-kicker::before {
    height: 18px;
  }

  .adm-brand-title {
    font-size: clamp(1.35rem, 5.8vw, 1.75rem);
    line-height: 1.12;
    max-width: 16ch;
  }

  .adm-brand-quote {
    display: none;
  }

  .adm-panel {
    min-height: 0;
    justify-content: flex-start;
    padding: 22px 20px max(24px, env(safe-area-inset-bottom));
  }

  .adm-logo {
    width: 136px;
    margin-bottom: 18px;
  }

  .adm-head h1 {
    font-size: 1.5rem;
  }

  .adm-head p {
    margin-bottom: 20px;
    font-size: 14px;
  }

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

  .adm-panel .adm-foot {
    margin-top: 20px;
    padding-top: 12px;
  }
}

@media (max-width: 480px) {
  .adm-brand {
    max-height: 188px;
    padding: 16px 16px 18px;
  }

  .adm-brand-title {
    font-size: 1.28rem;
    max-width: 15ch;
  }

  .adm-panel {
    padding: 18px 16px 20px;
  }

  .adm-logo {
    width: 124px;
    margin-bottom: 14px;
  }

  .adm-head h1 {
    font-size: 1.35rem;
  }

  .adm-head p {
    margin-bottom: 16px;
    font-size: 13px;
  }

  .adm-field label {
    font-size: 9px;
  }

  .adm-input {
    font-size: 16px;
    padding-top: 13px;
    padding-bottom: 13px;
  }

  .adm-btn {
    margin-top: 4px;
    padding: 14px 18px;
  }

  .adm-links {
    margin-top: 14px;
  }
}

@media (max-width: 960px) and (max-height: 740px) {
  .adm-brand {
    max-height: 160px;
  }

  .adm-brand-title {
    font-size: 1.2rem;
  }

  .adm-logo {
    width: 118px;
    margin-bottom: 12px;
  }

  .adm-head p {
    margin-bottom: 14px;
  }
}
