@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@600;700&display=swap');
@import url('/css/nomi-tokens.css');

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; color: var(--nomi-text); font-family: 'Inter', sans-serif; }
.nomi-auth-page {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 12%, rgba(1, 193, 160, .14), transparent 30rem),
    radial-gradient(circle at 88% 88%, rgba(20, 28, 62, .07), transparent 32rem),
    linear-gradient(145deg, #f6fcfa 0%, var(--nomi-page) 52%, #eaf6f2 100%);
}
.nomi-auth-page::before,
.nomi-auth-page::after {
  content: '';
  position: fixed;
  z-index: 0;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
  opacity: .55;
  animation: nomi-atmosphere 16s ease-in-out infinite alternate;
}
.nomi-auth-page::before { top: -16rem; right: -9rem; background: rgba(1, 193, 160, .12); }
.nomi-auth-page::after { bottom: -17rem; left: -8rem; background: rgba(14, 24, 55, .055); animation-delay: -7s; }
.nomi-auth-main { position: relative; z-index: 1; display: grid; place-items: center; width: 100%; padding: 46px 20px 24px; }
.nomi-auth-card {
  width: min(100%, 430px);
  padding: 38px 40px 36px;
  border: 1px solid rgba(224, 234, 230, .96);
  border-radius: var(--nomi-radius-card);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 46px rgba(14, 24, 55, .09);
  animation: nomi-card-enter .55s cubic-bezier(.2, .8, .2, 1) both;
}
.nomi-company-card { width: min(100%, 580px); }
.nomi-auth-brand { display: flex; justify-content: center; margin-bottom: 24px; }
.nomi-auth-logo { display: block; width: 152px; max-width: 56%; height: auto; animation: nomi-brand-enter .72s cubic-bezier(.2, .8, .2, 1) both; }
.nomi-auth-heading { margin-bottom: 25px; text-align: center; }
.nomi-auth-heading h1 { margin: 0 0 7px; color: var(--nomi-text); font-family: 'Poppins', sans-serif; font-size: 1.45rem; line-height: 1.3; }
.nomi-auth-heading p,
.nomi-auth-tenant {
  margin: 0;
  color: var(--nomi-muted);
  font-size: .92rem;
}
.nomi-auth-tenant {
  margin-top: 10px;
  color: var(--nomi-primary-dark);
  font-weight: 600;
}
.nomi-help-text { margin: 0; color: var(--nomi-muted); font-size: .9rem; line-height: 1.55; }
.nomi-form { display: grid; gap: 17px; }
.nomi-field { display: grid; gap: 7px; }
.nomi-field label,
.nomi-otp-field > span:first-child {
  color: var(--nomi-text);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.nomi-field input { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid var(--nomi-border); border-radius: var(--nomi-radius-control); color: var(--nomi-text); background: #fff; font: inherit; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.nomi-field input:focus { outline: 0; border-color: var(--nomi-primary-dark); box-shadow: 0 0 0 3px rgba(1, 193, 160, .14); transform: translateY(-1px); }
.nomi-field span,
.nomi-validation { color: var(--nomi-error); font-size: .8rem; }
.nomi-button-primary { position: relative; min-height: 48px; overflow: hidden; border: 0; border-radius: var(--nomi-radius-control); color: #fff; background: linear-gradient(120deg, var(--nomi-primary), var(--nomi-primary-dark)); font: 600 .94rem 'Inter', sans-serif; cursor: pointer; transition: transform .18s ease, filter .18s ease, box-shadow .18s ease; }
.nomi-button-primary:hover { transform: translateY(-2px); filter: saturate(1.08); box-shadow: 0 9px 20px rgba(0, 147, 123, .18); }
.nomi-button-primary:focus-visible,
.nomi-company-option:focus-visible,
.nomi-auth-link:focus-visible { outline: 3px solid rgba(1, 147, 123, .28); outline-offset: 3px; }
.nomi-button-primary:disabled { cursor: wait; filter: grayscale(.15); opacity: .72; transform: none; }
.nomi-auth-link { color: var(--nomi-primary-dark); font-size: .84rem; font-weight: 600; text-align: center; text-underline-offset: 3px; }
.nomi-alert { padding: 12px 14px; margin-bottom: 20px; border-radius: var(--nomi-radius-control); background: var(--nomi-soft); font-size: .86rem; line-height: 1.5; }
.nomi-alert-error { color: #8f2226; background: #ffebec; border-left: 3px solid var(--nomi-error); }
.nomi-company-list { display: grid; gap: 10px; }
.nomi-company-option { width: 100%; min-height: 68px; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 16px; border: 1px solid var(--nomi-border); border-radius: var(--nomi-radius-control); text-align: left; color: var(--nomi-text); background: #fff; cursor: pointer; transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.nomi-company-option:hover { border-color: var(--nomi-primary); background: #f8fffd; transform: translateX(3px); }
.nomi-company-name { font-weight: 600; }
.nomi-company-role { color: var(--nomi-muted); font-size: .84rem; }
.nomi-company-arrow { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--nomi-primary-dark); font-size: 1.3rem; }
.nomi-auth-footer { position: relative; z-index: 1; display: flex; justify-content: center; padding: 17px 24px 20px; color: var(--nomi-muted); font-size: .72rem; line-height: 1.5; text-align: center; }
.nomi-eyebrow { display: block; margin-bottom: 8px; color: var(--nomi-primary-dark); font-size: .68rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.nomi-otp-group { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 5px; }
.nomi-otp-cell { position: relative; display: block; color: var(--nomi-success) !important; }
.nomi-otp-cell::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; font-size: 1.15rem; font-weight: 700; transform: scale(.5); transition: opacity .2s ease, transform .25s cubic-bezier(.2, .9, .3, 1.3); pointer-events: none; }
.nomi-field .nomi-otp-box { min-width: 0; min-height: 56px; padding: 8px 2px; border: 1.5px solid var(--nomi-border); border-radius: 11px; text-align: center; font: 700 1.3rem 'Poppins', sans-serif; caret-color: var(--nomi-primary-dark); }
.nomi-field .nomi-otp-box:focus { border-color: var(--nomi-primary); box-shadow: 0 0 0 4px rgba(1, 193, 160, .13), 0 8px 18px rgba(14, 24, 55, .06); transform: translateY(-2px); }
.nomi-otp-box.is-filled { border-color: var(--nomi-primary-dark); background: #f7fffd; }
.nomi-otp-group.is-verifying .nomi-otp-box { animation: nomi-otp-pulse .8s ease-in-out infinite alternate; }
.nomi-otp-group.is-error { animation: nomi-otp-shake .42s ease; }
.nomi-otp-group.is-error .nomi-otp-box { border-color: var(--nomi-error); color: var(--nomi-error); background: #fff8f8; box-shadow: 0 0 0 3px rgba(229, 72, 77, .1); }
.nomi-otp-group.is-success .nomi-otp-box { border-color: var(--nomi-success); color: transparent; background: #eefaf5; box-shadow: 0 8px 20px rgba(31, 157, 108, .12); animation: nomi-otp-success .42s cubic-bezier(.2, .9, .3, 1.3) both; }
.nomi-otp-group.is-success .nomi-otp-cell::after { opacity: 1; transform: scale(1); }
.nomi-otp-group.is-success .nomi-otp-cell:nth-child(2) .nomi-otp-box { animation-delay: .06s; }
.nomi-otp-group.is-success .nomi-otp-cell:nth-child(3) .nomi-otp-box { animation-delay: .12s; }
.nomi-otp-group.is-success .nomi-otp-cell:nth-child(4) .nomi-otp-box { animation-delay: .18s; }
.nomi-otp-group.is-success .nomi-otp-cell:nth-child(5) .nomi-otp-box { animation-delay: .24s; }
.nomi-otp-group.is-success .nomi-otp-cell:nth-child(6) .nomi-otp-box { animation-delay: .3s; }
.nomi-otp-status { min-height: 22px; margin: 2px 0 0; color: var(--nomi-muted); font-size: .82rem; text-align: center; }
.nomi-otp-status.is-error { color: var(--nomi-error); }
.nomi-otp-status.is-success { color: var(--nomi-success); font-weight: 600; }
.nomi-mfa-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nomi-resend-button { min-height: 44px; padding: 7px 9px; border: 0; border-radius: 9px; color: var(--nomi-primary-dark); background: transparent; font: 600 .82rem 'Inter', sans-serif; cursor: pointer; }
.nomi-resend-button:hover:not(:disabled) { background: var(--nomi-soft); }
.nomi-resend-button:focus-visible { outline: 3px solid rgba(1, 147, 123, .3); outline-offset: 2px; }
.nomi-resend-button:disabled { color: var(--nomi-muted); cursor: not-allowed; opacity: .72; }
.nomi-security-tip { padding-top: 14px; border-top: 1px solid var(--nomi-border); text-align: center; font-size: .78rem !important; }
@keyframes nomi-card-enter { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes nomi-brand-enter { from { opacity: 0; transform: translateY(-8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes nomi-atmosphere { to { transform: translate3d(20px, -12px, 0) scale(1.06); } }
@keyframes nomi-otp-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes nomi-otp-pulse { from { border-color: var(--nomi-border); } to { border-color: var(--nomi-primary); box-shadow: 0 0 0 3px rgba(1, 193, 160, .1); } }
@keyframes nomi-otp-success { from { transform: scale(.88); } to { transform: scale(1); } }
@media (max-width: 560px) {
  .nomi-auth-main { padding: 24px 14px 10px; }
  .nomi-auth-card { padding: 30px 20px 28px; }
  .nomi-auth-logo { width: 140px; }
  .nomi-auth-footer { padding: 14px 16px 18px; }
  .nomi-otp-group { gap: 5px; }
  .nomi-field .nomi-otp-box { min-height: 50px; border-radius: 9px; font-size: 1.1rem; }
  .nomi-mfa-meta { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 370px) {
  .nomi-auth-card { padding-inline: 16px; }
  .nomi-otp-group { gap: 4px; }
  .nomi-field .nomi-otp-box { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
