/*
 * GlideflowAI authentication skin.
 * This stylesheet is intentionally scoped to body.gf-auth. The class is applied
 * only while new-api's sign-in or sign-up card is present.
 */

body.gf-auth {
  --semi-font-family-regular: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --semi-color-primary: #07110f;
  --semi-color-primary-hover: #17241f;
  --semi-color-primary-active: #000706;
  --semi-color-primary-disabled: #aeb9b5;
  --semi-color-primary-light-default: rgba(7, 17, 15, 0.055);
  --semi-color-primary-light-hover: rgba(7, 17, 15, 0.08);
  --semi-color-primary-light-active: rgba(7, 17, 15, 0.12);
  --semi-color-link: #047857;
  --semi-color-link-hover: #065f46;
  --semi-color-focus-border: #059669;
}

/* Light stays airy: emerald only gives a barely perceptible point of warmth. */
body.gf-auth:not([theme-mode="dark"]) {
  background-color: #f7f8fb !important;
  background-image:
    radial-gradient(42rem 25rem at 50% 18%, rgba(5, 150, 105, 0.055), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(247, 248, 251, 0));
}

/* In dark mode Semi retains ownership of all neutral surfaces and text. */
body.gf-auth[theme-mode="dark"] {
  --semi-color-primary: #34d399;
  --semi-color-primary-hover: #6ee7b7;
  --semi-color-primary-active: #10b981;
  --semi-color-primary-disabled: #4b635b;
  --semi-color-primary-light-default: rgba(52, 211, 153, 0.14);
  --semi-color-primary-light-hover: rgba(52, 211, 153, 0.2);
  --semi-color-primary-light-active: rgba(52, 211, 153, 0.26);
  --semi-color-link: #6ee7b7;
  --semi-color-link-hover: #a7f3d0;
  --semi-color-focus-border: #34d399;
}

/* Establish a calm, stable centre without changing new-api's component tree. */
/* The brand and account controls stay visible; only the site-directory links hide. */
body.gf-auth .gf-auth-nav {
  display: flex !important;
}
body.gf-auth .gf-auth-nav-link {
  display: none !important;
}
body.gf-auth .public-page-content {
  min-height: 100dvh;
}
body.gf-auth .classic-page-fill {
  min-height: max(580px, 100dvh);
  padding: clamp(36px, 7vh, 76px) 20px !important;
}
body.gf-auth .classic-page-fill > .w-full.max-w-sm {
  margin-top: 0 !important;
}
body.gf-auth .flex.flex-col.items-center {
  width: min(100%, 430px);
}
body.gf-auth .w-full.max-w-md {
  width: 100%;
}

/* The card is the sole elevated object, with a precise 16px corner system. */
body.gf-auth .semi-card {
  overflow: visible;
  border: 1px solid rgba(7, 17, 15, 0.09) !important;
  border-radius: 16px !important;
  box-shadow:
    0 18px 45px -30px rgba(7, 17, 15, 0.3),
    0 2px 7px -5px rgba(7, 17, 15, 0.16) !important;
}
body.gf-auth:not([theme-mode="dark"]) .semi-card {
  background: rgba(255, 255, 255, 0.92);
}
body.gf-auth[theme-mode="dark"] .semi-card {
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow:
    0 20px 50px -34px rgba(0, 0, 0, 0.82),
    0 1px 0 rgba(255, 255, 255, 0.025) inset !important;
}

/* Let the existing heading and controls establish a more deliberate rhythm. */
body.gf-auth .semi-card .semi-card-header {
  padding-bottom: 8px;
}
body.gf-auth .semi-card .semi-card-body {
  padding-top: 18px;
}
body.gf-auth .semi-card input,
body.gf-auth .semi-card .semi-input-wrapper,
body.gf-auth .semi-card .semi-select {
  border-radius: 10px;
}
body.gf-auth .semi-card .semi-input-wrapper:focus-within,
body.gf-auth .semi-card input:focus {
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14);
}

body.gf-auth .semi-card button {
  min-height: 42px;
  border-radius: 10px !important;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}
body.gf-auth .semi-card button:not(:disabled):hover {
  transform: translateY(-1px);
}
body.gf-auth .semi-card button:not(:disabled):active {
  transform: translateY(0);
}
body.gf-auth .semi-card .semi-button-primary {
  box-shadow: 0 1px 2px rgba(7, 17, 15, 0.2);
}
body.gf-auth .semi-card .semi-button-primary:not(:disabled):hover {
  box-shadow: 0 7px 15px -10px rgba(7, 17, 15, 0.42);
}
body.gf-auth[theme-mode="dark"] .semi-card .semi-button-primary:not(:disabled):hover {
  box-shadow: 0 7px 18px -10px rgba(52, 211, 153, 0.28);
}
body.gf-auth .semi-card .semi-button-tertiary {
  border-color: rgba(7, 17, 15, 0.14) !important;
}
body.gf-auth[theme-mode="dark"] .semi-card .semi-button-tertiary {
  border-color: rgba(255, 255, 255, 0.16) !important;
}

/* Legal consent is present but calm. It is an interaction boundary, not a banner. */
body.gf-auth .gf-consent {
  margin: 18px 0 2px;
  padding: 12px 13px;
  border: 1px solid rgba(7, 17, 15, 0.1);
  border-radius: 12px;
  background: rgba(7, 17, 15, 0.025);
  color: var(--semi-color-text-2);
  font-size: 12.5px;
  line-height: 1.55;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
body.gf-auth[theme-mode="dark"] .gf-consent {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
}
body.gf-auth .gf-consent label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  cursor: pointer;
}
body.gf-auth .gf-consent input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  cursor: pointer;
  accent-color: #059669;
}
body.gf-auth .gf-consent a {
  color: var(--semi-color-link);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
body.gf-auth .gf-consent a:hover {
  color: var(--semi-color-link-hover);
}
body.gf-auth .gf-consent-hint {
  display: none;
  margin: 8px 0 0 25px;
  color: #b42318;
  font-size: 12px;
  line-height: 1.4;
}
body.gf-auth[theme-mode="dark"] .gf-consent-hint {
  color: #fda4af;
}
body.gf-auth .gf-consent.gf-consent-blocked {
  border-color: rgba(180, 35, 24, 0.5);
  background: rgba(180, 35, 24, 0.045);
}
body.gf-auth .gf-consent.gf-consent-blocked .gf-consent-hint {
  display: block;
}
body.gf-auth:not(.gf-consent-ok) .semi-card button.gf-auth-action {
  opacity: 0.58;
}
body.gf-auth.gf-consent-ok .semi-card button.gf-auth-action {
  opacity: 1;
}

@media (max-width: 480px) {
  body.gf-auth .classic-page-fill {
    min-height: calc(100dvh - 56px);
    padding: 24px 14px 36px !important;
  }
  body.gf-auth .semi-card {
    border-radius: 14px !important;
  }
  body.gf-auth .gf-consent {
    margin-top: 14px;
    padding: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.gf-auth .semi-card button,
  body.gf-auth .gf-consent {
    transition: none;
  }
  body.gf-auth .semi-card button:not(:disabled):hover,
  body.gf-auth .semi-card button:not(:disabled):active {
    transform: none;
  }
}
