/*
 * The EOS Omnia sign-in screen, reproduced from the app:
 *   eos-omnia/src/app/globals.css (tokens)
 *   eos-omnia/src/app/sign-in/sign-in.module.css (page)
 *   eos-omnia/src/components/header/SiteHeader.module.css (logo pill)
 * FirebaseUI's own styles come from firebase-ui.css (@firebase-oss/ui-styles).
 * Keep the values in step with those files.
 */

:root {
  --background: #eaf3ff;
  --foreground: #0b1220;
  --bg-dark: #02102c;
  --label-blue: #699fff;
  --text-main: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.86);
  --border-subtle: rgba(255, 255, 255, 0.22);
  --surface-opacity: 0.7;
  --nav-logo-h: 60px;
  --font-omnia-body: "Montserrat";
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-omnia-body), system-ui, -apple-system, sans-serif;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

/* Page */

.page {
  --fui-primary: var(--bg-dark);
  --fui-primary-hover: rgba(8, 28, 72, 0.98);
  --fui-primary-surface: var(--text-main);
  --sign-in-page-overlay-top: rgba(255, 255, 255, 0.66);
  --sign-in-page-overlay-bottom: rgba(255, 255, 255, 0.76);
  --sign-in-card-bg: rgba(255, 255, 255, 0.96);
  --sign-in-card-border: rgba(2, 16, 44, 0.12);
  --sign-in-card-shadow: 0 10px 30px rgba(2, 16, 44, 0.12);
  --sign-in-text: var(--bg-dark);
  --sign-in-text-muted: rgba(2, 16, 44, 0.72);
  --sign-in-text-soft: rgba(2, 16, 44, 0.58);
  --sign-in-text-subtle: rgba(2, 16, 44, 0.5);
  --sign-in-button-surface: rgba(255, 255, 255, 0.96);
  --sign-in-button-surface-hover: rgba(255, 255, 255, 0.88);
  position: relative;
  box-sizing: border-box;
  min-height: 100vh;
  padding: 2rem 1rem 4.5rem;
  background:
    linear-gradient(var(--sign-in-page-overlay-top), var(--sign-in-page-overlay-bottom)),
    url("/assets/windfarm_overlay.jpg") center / cover no-repeat;
}

.contentWrap {
  min-height: calc(100vh - 6.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.authPanel {
  width: 100%;
  max-width: 24rem;
}

.authPanel .fui-button:not(.fui-button--secondary) {
  background-color: var(--bg-dark);
  border-color: var(--bg-dark);
  color: var(--text-main);
}

.authPanel .fui-button:not(.fui-button--secondary):hover {
  background-color: var(--fui-primary-hover);
}

.providerActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.registerPrompt {
  margin: 1rem 0 0;
  color: var(--sign-in-text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
}

.registerLink {
  color: var(--bg-dark);
  font-weight: 700;
  text-decoration: none;
}

.registerLink:hover {
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .authPanel .fui-button:not(.fui-button--secondary) {
    background-color: var(--color-text);
    border-color: var(--color-text);
    color: var(--bg-dark);
  }

  .authPanel .fui-button:not(.fui-button--secondary):hover {
    background-color: var(--color-text-muted);
  }

  .registerPrompt {
    color: var(--color-text-muted);
  }

  .registerLink {
    color: var(--color-text);
  }
}

.debugError {
  box-sizing: border-box;
  width: min(24rem, calc(100vw - 2rem));
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid #fecaca;
  border-radius: 0.75rem;
  background: #fff1f2;
  color: #881337;
}

.linkNotice {
  box-sizing: border-box;
  width: min(24rem, calc(100vw - 2rem));
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.75rem;
  background: #eff6ff;
  color: #1e3a8a;
}

.linkNoticeTitle,
.debugErrorTitle {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.linkNoticeText {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.debugErrorLine {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.signedInCard,
.loadingCard {
  box-sizing: border-box;
  width: min(24rem, calc(100vw - 2rem));
  padding: 2rem;
  border: 1px solid var(--sign-in-card-border);
  border-radius: 12px;
  background: var(--sign-in-card-bg);
  box-shadow: var(--sign-in-card-shadow);
  color: var(--sign-in-text);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  color: var(--label-blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signedInTitle,
.loadingTitle {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.signedInText,
.loadingText {
  margin: 1rem 0 0;
  color: var(--sign-in-text-muted);
  line-height: 1.7;
}

.signOutButton {
  appearance: none;
  display: block;
  width: fit-content;
  margin: 1.5rem auto 0;
  border: 1px solid var(--sign-in-card-border);
  border-radius: 8px;
  background: var(--sign-in-button-surface);
  color: var(--sign-in-text);
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.signOutButton:hover {
  background: var(--sign-in-button-surface-hover);
}

.footer {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  color: var(--sign-in-text-subtle);
  font-size: 0.7rem;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
}

/* Consent step: the signed-in card's look, with the app's primary button. */

.consentAccount {
  margin: 1rem 0 0;
  color: var(--sign-in-text-soft);
  font-size: 0.8125rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.consentClient {
  margin: 0.75rem 0 0;
  color: var(--sign-in-text-soft);
  font-size: 0.8125rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.consentWarning {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.linkButton {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bg-dark);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.organizationChoices {
  margin: 1.25rem 0 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 0.5rem;
}

.organizationChoices legend {
  margin-bottom: 0.5rem;
  padding: 0;
  color: var(--sign-in-text);
  font-size: 0.875rem;
  font-weight: 600;
}

.organizationChoice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--sign-in-card-border);
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
}

.organizationChoice:has(input:checked) {
  border-color: var(--bg-dark);
}

.organizationChoice input {
  accent-color: var(--bg-dark);
  margin: 0;
}

.consentActions {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.primaryButton {
  appearance: none;
  width: 100%;
  min-height: 2.7rem;
  border: 1px solid var(--bg-dark);
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text-main);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.primaryButton:hover {
  background: rgba(8, 28, 72, 0.98);
}

.primaryButton:disabled,
.signOutButton:disabled {
  opacity: 0.6;
  cursor: wait;
}

.consentActions .signOutButton {
  width: 100%;
  min-height: 2.7rem;
  margin: 0;
  font-size: 0.875rem;
}

/*
 * Enterprise badge, as the app's ProFeatureBadge tone="enterprise"
 * (eos-omnia/src/components/ui/ui.module.css): centred above the title on the
 * sign-in card, inline after the eyebrow on the others.
 */

.enterpriseBadge {
  display: inline-flex;
  vertical-align: 1px;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  border: 0;
  background: #65d58a;
  color: #04132d;
  font-family: var(--font-omnia-body), system-ui, -apple-system, sans-serif;
  font-size: 0.68rem;
  font-weight: 820;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fui-card__header .enterpriseBadge {
  margin: 0 auto 0.6rem;
}

/* Connect page */

.authPanelWide {
  max-width: 36rem;
}

.authPanelWide .signedInCard {
  width: min(36rem, calc(100vw - 2rem));
}

.connectTabs {
  margin: 1.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.connectTab {
  appearance: none;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--sign-in-card-border);
  border-radius: 999px;
  background: var(--sign-in-button-surface);
  color: var(--sign-in-text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.connectTab[aria-selected="true"] {
  border-color: var(--bg-dark);
  background: var(--bg-dark);
  color: var(--text-main);
}

.connectPanel {
  margin-top: 1rem;
}

.connectSteps {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  list-style: decimal;
  color: var(--sign-in-text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.connectSteps strong {
  color: var(--sign-in-text);
}

.connectNote {
  margin: 0.75rem 0 0;
  color: var(--sign-in-text-soft);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.signedInCard code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
}

.copyBlock {
  margin: 0.75rem 0 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0.6rem 0.6rem 0.85rem;
  border: 1px solid var(--sign-in-card-border);
  border-radius: 8px;
  background: rgba(2, 16, 44, 0.04);
}

.copyBlock code {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.copyButton {
  appearance: none;
  flex-shrink: 0;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--sign-in-card-border);
  border-radius: 6px;
  background: var(--sign-in-button-surface);
  color: var(--sign-in-text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.installButton {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Landing page */

.connectorUrl {
  margin: 1.25rem 0 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--sign-in-card-border);
  border-radius: 8px;
  background: rgba(2, 16, 44, 0.04);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.connectorUrl code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  user-select: all;
}

/* Logo pill */

.header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) calc(1.25rem + env(safe-area-inset-right, 0px)) 0 calc(1.25rem + env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  pointer-events: none;
  font-family: var(--font-omnia-body), system-ui, -apple-system, sans-serif;
  --header-surface-strong:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(2, 16, 44, var(--surface-opacity)), rgba(2, 16, 44, var(--surface-opacity)));
  --header-border: var(--border-subtle);
  --header-highlight: rgba(255, 255, 255, 0.08);
  --header-shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.18);
  --header-text: var(--accent-soft);
}

.nav {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 1rem;
  pointer-events: none;
}

.brandShell {
  position: relative;
  z-index: 2;
  width: fit-content;
  max-width: 100%;
  pointer-events: auto;
  background: var(--header-surface-strong);
  border: 1px solid var(--header-border);
  border-radius: 18px;
  box-shadow: var(--header-shadow-soft), inset 0 1px 0 var(--header-highlight), inset 0 -4px 8px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.brand {
  width: fit-content;
  max-width: 100%;
  padding: 14px 16px 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.56rem;
  text-decoration: none;
}

.brandLogo {
  height: var(--nav-logo-h);
  width: auto;
  display: block;
  flex-shrink: 0;
}

.brandStrapline {
  display: block;
  max-width: 16.5rem;
  text-align: center;
  color: var(--header-text);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

@media (min-width: 1600px) {
  .header {
    padding-left: calc(2rem + env(safe-area-inset-left, 0px));
    padding-right: calc(2rem + env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 820px) {
  .page {
    padding-top: 6.5rem;
    padding-bottom: 5.5rem;
  }

  .contentWrap {
    min-height: calc(100vh - 12rem);
  }

  .footer {
    font-size: 0.65rem;
  }

  .header {
    padding: calc(0.8rem + env(safe-area-inset-top, 0px)) calc(0.85rem + env(safe-area-inset-right, 0px)) 0 calc(0.85rem + env(safe-area-inset-left, 0px));
  }

  .brand {
    gap: 0;
    padding: 10px 12px;
  }

  .brandLogo {
    height: 38px;
  }

  .brandStrapline {
    display: none;
  }
}
