.enm-auth-page {
  color: #17345f;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.enm-auth-page * { box-sizing: border-box; }
.enm-auth-page a { text-decoration: none; }

.enm-auth-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0;
}
.enm-auth-back {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #dce5f5;
  border-radius: 4px;
  color: #17345f;
  font-weight: 700;
  background: rgba(255,255,255,.5);
  margin-bottom: 0;
}
.enm-auth-notice {
  max-width: 820px;
  margin: 16px auto;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
}
.enm-auth-notice.is-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.enm-auth-notice.is-success { background: #ecfdf5; color: #047857; border: 1px solid #bbf7d0; }

.enm-auth-card {
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 52px 56px;
  box-shadow: 0 18px 50px rgba(30, 64, 175, .04);
}
.enm-auth-back + .enm-auth-card,
.enm-auth-back + .enm-auth-notice + .enm-auth-card { margin-top: 0; }
.enm-auth-card h1 {
  margin: 0 0 18px;
  text-align: center;
  color: #17345f;
  font-size: 32px;
  line-height: 1.25;
  font-weight: 800;
}
.enm-auth-subtitle {
  margin: 0 auto 38px;
  color: #17345f;
  text-align: center;
  font-size: 18px;
}

.enm-auth-card--choice { padding-bottom: 50px; }
.enm-auth-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  max-width: 620px;
  margin: 0 auto;
}
.enm-auth-role {
  min-height: 370px;
  border: 1px solid #dbe3f2;
  border-radius: 16px;
  color: #17345f;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.enm-auth-role:hover {
  border-color: #2f64d6;
  box-shadow: 0 14px 34px rgba(47, 100, 214, .1);
  transform: translateY(-2px);
}
.enm-auth-role__icon {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f4f2ff, #eef7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.enm-auth-role__icon svg {
  width: 54px;
  height: 54px;
  stroke: #17345f;
  stroke-width: 1.8;
  fill: none;
}
.enm-auth-role strong {
  font-size: 22px;
  margin-bottom: 12px;
}
.enm-auth-role small {
  color: #17345f;
  font-size: 16px;
  line-height: 1.45;
  max-width: 220px;
  min-height: 48px;
}
.enm-auth-btn,
.enm-auth-submit {
  min-width: 164px;
  min-height: 44px;
  border: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, #4268e8, #009cf2);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  margin-top: auto;
}

.enm-auth-card--form {
  max-width: 820px;
  padding-top: 52px;
  padding-bottom: 50px;
}
.enm-auth-card--compact { padding-top: 52px; padding-bottom: 48px; }
.enm-auth-card--logged-in .enm-auth-subtitle {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.enm-auth-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}
.enm-auth-link {
  color: #3867d6;
  font-weight: 700;
}
.enm-auth-field {
  width: 100%;
  height: 56px;
  border: 1px solid #dbe3f2;
  border-radius: 4px;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  background: #fff;
  overflow: hidden;
}
.enm-auth-field-wrap { margin-bottom: 16px; }
.enm-auth-field-wrap .enm-auth-field { margin-bottom: 0; }
.enm-auth-field:focus-within {
  border-color: #78a4ff;
  box-shadow: 0 0 0 3px rgba(47, 100, 214, .08);
}
.enm-auth-field-wrap.is-error .enm-auth-field {
  border-color: #ef4444;
  background: #fffafa;
}
.enm-auth-field-wrap.is-error .enm-auth-field:focus-within {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
}
.enm-auth-field-wrap.is-error .enm-auth-field__icon {
  background: #fff1f2;
}
.enm-auth-field-error {
  display: none;
  margin-top: 6px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.enm-auth-field-wrap.is-error .enm-auth-field-error,
.enm-auth-terms-wrap.is-error .enm-auth-field-error {
  display: block;
}
.enm-password-rules {
  display: none;
  margin-top: 8px;
  padding: 2px 0 0;
}
.enm-password-rules.is-visible { display: block; }
.enm-password-rules__title { display: none; }
.enm-password-rules ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.enm-password-rules li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
.enm-password-rules li span {
  width: 14px;
  height: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  flex: 0 0 14px;
  position: relative;
}
.enm-password-rules li.is-valid {
  color: #047857;
}
.enm-password-rules li.is-valid span {
  border-color: #10b981;
  background: #10b981;
}
.enm-password-rules li.is-valid span::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.enm-auth-field__icon {
  width: 48px;
  height: 44px;
  margin-left: 8px;
  border-radius: 2px;
  background: #f0f7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.enm-auth-field__icon svg,
.enm-auth-eye svg {
  width: 18px;
  height: 18px;
  stroke: #7193c9;
  stroke-width: 1.8;
  fill: none;
}
.enm-auth-page .enm-auth-field input,
.enm-auth-page .enm-auth-field input[type="text"],
.enm-auth-page .enm-auth-field input[type="email"],
.enm-auth-page .enm-auth-field input[type="tel"],
.enm-auth-page .enm-auth-field input[type="password"] {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  max-width: none;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  padding: 0 12px !important;
  color: #17345f;
  font-size: 16px;
  line-height: 1.2;
  background: transparent !important;
  border-radius: 0 !important;
  transform: none !important;
}
.enm-auth-page .enm-auth-field input::placeholder { color: #95a5ba; opacity: 1; }
.enm-auth-page .enm-auth-field input:focus {
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}
.enm-auth-eye {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 6px;
  flex-shrink: 0;
}
.enm-auth-code-field input {
  text-align: left;
  letter-spacing: .08em;
}
.enm-auth-send-code {
  min-width: 92px;
  margin: 0;
  height: 100%;
  border: 0;
  border-radius: 0 4px 4px 0;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}
.enm-auth-send-code:disabled {
  opacity: .65;
  cursor: not-allowed;
}
.enm-auth-code-note {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.enm-auth-code-note.is-success { color: #047857; }
.enm-auth-code-note.is-error { color: #dc2626; }
.enm-auth-row,
.enm-auth-terms {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #17345f;
  font-size: 15px;
  margin: 4px 0 34px;
}
.enm-auth-terms-wrap { margin: 4px 0 34px; }
.enm-auth-terms-wrap .enm-auth-terms { margin: 0; }
.enm-auth-terms-wrap.is-error .enm-auth-terms {
  color: #b91c1c;
}
.enm-auth-terms-wrap.is-error input[type="checkbox"] {
  outline: 2px solid rgba(239, 68, 68, .25);
}
.enm-auth-row label,
.enm-auth-terms {
  justify-content: flex-start;
}
.enm-auth-row a,
.enm-auth-terms a,
.enm-auth-switch a {
  color: #3867d6;
  font-weight: 700;
}
.enm-auth-page .enm-auth-row input[type="checkbox"],
.enm-auth-page .enm-auth-terms input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  margin: 0 8px 0 0 !important;
  border: 1px solid #dbe3f2 !important;
  box-shadow: none !important;
  accent-color: #3867d6;
}
.enm-auth-submit {
  min-width: 190px;
  margin: 0 auto;
  display: flex;
}
.enm-auth-switch {
  margin: 28px 0 0;
  text-align: center;
  color: #17345f;
  font-size: 20px;
}
.enm-auth-card--form + .enm-auth-switch,
.enm-auth-card--choice + .enm-auth-switch,
.enm-auth-card--compact + .enm-auth-switch { margin-top: 28px; }

@media (max-width: 900px) {
  .enm-auth-card { padding: 36px 24px; }
  .enm-auth-role-grid { gap: 18px; }
}
@media (max-width: 620px) {
  .enm-auth-role-grid { grid-template-columns: 1fr; }
  .enm-auth-card h1 { font-size: 26px; }
  .enm-auth-switch,
  .enm-auth-card--form + .enm-auth-switch,
  .enm-auth-card--choice + .enm-auth-switch,
  .enm-auth-card--compact + .enm-auth-switch { margin-top: 52px; font-size: 17px; }
  .enm-auth-row { align-items: flex-start; flex-direction: column; }
  .enm-auth-send-code { min-width: 78px; padding: 0 8px; font-size: 12px; }
  .enm-password-rules ul { grid-template-columns: 1fr; }
}
