/*
 * Mailcore SSO v2 — light-only product shell.
 * The geometry and semantic colour roles follow the Mailcore/Kumo dashboard
 * system. Keep this file self-contained: the authentication page deliberately
 * does not load the upstream UI bundle.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./inter-cyrillic-v1.woff2") format("woff2-variations");
}

:root {
  color-scheme: light;
  --mc-canvas: #fbfbfb;
  --mc-base: #ffffff;
  --mc-elevated: #f8f8f8;
  --mc-recessed: #f2f2f2;
  --mc-hover: #f5f5f5;
  --mc-line: rgba(10, 10, 10, 0.1);
  --mc-line-strong: rgba(10, 10, 10, 0.18);
  --mc-input-line: #949494;
  --mc-text: #0a0a0a;
  --mc-text-default: #18181b;
  --mc-text-subtle: #626262;
  --mc-brand: #056dff;
  --mc-brand-hover: #1447e6;
  --mc-brand-ring: #045ede;
  --mc-brand-tint: #eff6ff;
  --mc-on-brand: #ffffff;
  --mc-danger: #b42318;
  --mc-danger-tint: #fff1f0;
  --mc-danger-line: #f4c7c3;
  --mc-success: #176b3a;
  --mc-success-tint: #edf8f1;
  --mc-success-line: #b8dec8;
  --mc-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --mc-shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.06);
  --mc-font: "Inter", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--mc-canvas);
  color-scheme: light;
  font-family: var(--mc-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) auto;
  background: var(--mc-canvas);
  color: var(--mc-text-default);
  font-family: inherit;
}

button,
input {
  margin: 0;
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--mc-brand-ring);
  text-decoration: none;
}

a:hover {
  color: var(--mc-brand-hover);
}

:focus-visible {
  outline: 2px solid var(--mc-brand);
  outline-offset: 2px;
}

::selection {
  background: #dbeafe;
  color: var(--mc-text);
}

.mc-skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  min-height: 40px;
  padding: 9px 12px;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--mc-base);
  box-shadow: 0 0 0 1px var(--mc-line-strong), var(--mc-shadow-sm);
  color: var(--mc-text);
  font-weight: 600;
}

.mc-skip-link:focus {
  transform: translateY(0);
}

.mc-auth-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--mc-line);
  background: rgba(251, 251, 251, 0.96);
}

.mc-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  gap: 8px;
  border-radius: 8px;
  color: var(--mc-text);
}

.mc-brand:hover {
  color: var(--mc-text);
}

.mc-brand img {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

.mc-brand__name {
  color: var(--mc-text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.mc-brand__dot {
  color: #f48120;
}

.mc-brand__tld {
  color: var(--mc-text-subtle);
  font-weight: 500;
}

.mc-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mc-header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  gap: 6px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--mc-text-default);
  font-size: 13px;
  font-weight: 500;
}

.mc-header-link:hover {
  background: var(--mc-hover);
  color: var(--mc-text);
}

.mc-auth-main {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.mc-auth-shell {
  width: min(100%, 900px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 416px);
  align-items: center;
  gap: 64px;
}

.mc-auth-intro {
  min-width: 0;
}

.mc-auth-intro__title {
  max-width: 440px;
  margin: 0;
  color: var(--mc-text);
  font-size: clamp(28px, 3.1vw, 38px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.mc-auth-intro__lead {
  max-width: 440px;
  margin: 16px 0 0;
  color: var(--mc-text-subtle);
  font-size: 15px;
  line-height: 1.65;
}

.mc-auth-points {
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.mc-auth-points li {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  padding: 10px 0;
}

.mc-auth-points__icon {
  display: inline-flex;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--mc-base);
  box-shadow: 0 0 0 1px var(--mc-line), var(--mc-shadow-xs);
  color: var(--mc-brand-ring);
}

.mc-auth-points__icon svg {
  width: 18px;
  height: 18px;
}

.mc-auth-points li > span:last-child {
  display: grid;
  min-width: 0;
}

.mc-auth-points strong {
  color: var(--mc-text-default);
  font-size: 14px;
  font-weight: 600;
}

.mc-auth-points small {
  margin-top: 1px;
  color: var(--mc-text-subtle);
  font-size: 13px;
}

.mc-auth-card {
  min-width: 0;
  padding: 24px;
  border-radius: 8px;
  background: var(--mc-base);
  box-shadow: 0 0 0 1px var(--mc-line), var(--mc-shadow-xs);
}

.mc-auth-card:focus {
  outline: none;
}

.mc-auth-card:focus-visible {
  outline: 2px solid var(--mc-brand);
  outline-offset: 2px;
}

.mc-auth-card__heading {
  margin-bottom: 24px;
}

.mc-auth-card__kicker {
  margin: 0 0 6px;
  color: var(--mc-brand-ring) !important;
  font-size: 12px !important;
  font-weight: 600;
  text-transform: uppercase;
}

.mc-auth-card__heading h1 {
  margin: 0;
  color: var(--mc-text);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.mc-auth-card__heading > p:last-child {
  margin: 8px 0 0;
  color: var(--mc-text-subtle);
  font-size: 14px;
  line-height: 1.55;
}

.mc-alerts {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.mc-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--mc-success-line);
  border-radius: 8px;
  background: var(--mc-success-tint);
  color: var(--mc-success);
  font-size: 13px;
}

.mc-alert svg {
  flex: 0 0 18px;
  margin-top: 1px;
}

.mc-alert--error {
  border-color: var(--mc-danger-line);
  background: var(--mc-danger-tint);
  color: var(--mc-danger);
}

.mc-auth-form,
.mc-field {
  display: grid;
}

.mc-auth-form {
  gap: 16px;
}

.mc-field {
  gap: 7px;
}

.mc-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mc-field label {
  color: var(--mc-text-default);
  font-size: 14px;
  font-weight: 500;
}

.mc-input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--mc-input-line);
  border-radius: 8px;
  outline: 0;
  background: var(--mc-base);
  box-shadow: var(--mc-shadow-xs);
  color: var(--mc-text);
  font-size: 14px;
  line-height: 1;
}

.mc-input:hover {
  border-color: #737373;
}

.mc-input:focus-visible {
  border-color: var(--mc-brand);
  outline: 0;
  box-shadow: 0 0 0 2px rgba(5, 109, 255, 0.22), var(--mc-shadow-xs);
}

.mc-input[aria-invalid="true"] {
  border-color: var(--mc-danger);
}

.mc-input[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.18), var(--mc-shadow-xs);
}

.mc-input::placeholder {
  color: #757575;
  opacity: 1;
}

.mc-password {
  position: relative;
}

.mc-input--password {
  padding-right: 44px;
}

.mc-password__toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--mc-text-subtle);
  cursor: pointer;
}

.mc-password__toggle:hover {
  background: var(--mc-hover);
  color: var(--mc-text);
}

.mc-password__toggle:focus-visible {
  outline-offset: -2px;
}

.mc-eye {
  display: block;
}

.mc-eye--hide,
.mc-password__toggle[aria-pressed="true"] .mc-eye--show {
  display: none;
}

.mc-password__toggle[aria-pressed="true"] .mc-eye--hide {
  display: block;
}

.mc-field__hint,
.mc-field__error {
  margin: -1px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.mc-field__hint {
  color: var(--mc-text-subtle);
}

.mc-field__hint--warning,
.mc-field__error {
  color: var(--mc-danger);
}

.mc-auth-actions {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.mc-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  gap: 8px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.mc-button--primary {
  background: var(--mc-brand);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.28),
    0 0 0 1px var(--mc-brand-ring), var(--mc-shadow-xs);
  color: var(--mc-on-brand);
}

.mc-button--primary:hover {
  background: var(--mc-brand-hover);
  color: var(--mc-on-brand);
}

.mc-button--secondary {
  background: var(--mc-base);
  box-shadow: 0 0 0 1px var(--mc-line-strong), var(--mc-shadow-xs);
  color: var(--mc-text-default);
}

.mc-button--secondary:hover {
  background: var(--mc-hover);
  color: var(--mc-text);
}

.mc-button:active {
  transform: translateY(1px);
}

.mc-button[aria-busy="true"] {
  cursor: wait;
  pointer-events: none;
}

.mc-button__spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: mc-spin 0.7s linear infinite;
  opacity: 0.85;
}

.mc-button[aria-busy="true"] .mc-button__spinner {
  display: block;
}

@keyframes mc-spin {
  to {
    transform: rotate(360deg);
  }
}

.mc-auth-onboarding {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 6px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--mc-line);
  color: var(--mc-text-subtle);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.mc-auth-onboarding a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(4, 94, 222, 0.35);
  text-underline-offset: 3px;
}

.mc-auth-onboarding a:hover {
  text-decoration-color: currentColor;
}

.mc-auth-onboarding + .mc-auth-card__security {
  margin-top: 16px;
  padding-top: 0;
  border-top: 0;
}

.mc-auth-card__security {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--mc-line);
  color: var(--mc-text-subtle);
  font-size: 12px;
  line-height: 1.5;
}

.mc-auth-card__security svg {
  flex: 0 0 16px;
  margin-top: 1px;
  color: var(--mc-text-default);
}

.mc-auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 7px;
  padding: 8px 24px;
  border-top: 1px solid var(--mc-line);
  color: var(--mc-text-subtle);
  font-size: 12px;
}

.mc-auth-footer a {
  border-radius: 4px;
  color: var(--mc-text-subtle);
  text-decoration: underline;
  text-decoration-color: rgba(98, 98, 98, 0.35);
  text-underline-offset: 3px;
}

.mc-auth-footer a:hover {
  color: var(--mc-text);
  text-decoration-color: currentColor;
}

@media (max-width: 839px) {
  .mc-auth-main {
    align-items: flex-start;
    padding: 32px 24px;
  }

  .mc-auth-shell {
    width: min(100%, 416px);
    display: block;
  }

  .mc-auth-intro {
    display: none;
  }
}

@media (max-width: 479px) {
  body {
    grid-template-rows: 58px minmax(0, 1fr) auto;
  }

  .mc-auth-header {
    padding: 0 16px;
  }

  .mc-auth-main {
    padding: 20px 12px 28px;
  }

  .mc-auth-card {
    padding: 20px;
    border-radius: 8px;
  }

  .mc-auth-card__heading {
    margin-bottom: 20px;
  }

  .mc-input {
    height: 44px;
    font-size: 16px;
  }

  .mc-brand,
  .mc-header-link,
  .mc-button,
  .mc-auth-onboarding a {
    min-height: 44px;
  }

  .mc-auth-footer {
    flex-wrap: wrap;
    padding-right: 16px;
    padding-left: 16px;
  }

  .mc-auth-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

@media (pointer: coarse) {
  .mc-brand,
  .mc-header-link,
  .mc-input,
  .mc-button,
  .mc-auth-onboarding a {
    min-height: 44px;
  }

  .mc-input {
    height: 44px;
    font-size: 16px;
  }

  .mc-password__toggle {
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
  }

  .mc-input--password {
    padding-right: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
