:root {
    --auth-bg-1: #eef2ff;
    --auth-bg-2: #f8fafc;
    --auth-bg-3: #ede9fe;
  
    --auth-primary: #5b5cf0;
    --auth-primary-dark: #4647d9;
    --auth-secondary: #8b5cf6;
    --auth-accent: #06b6d4;
  
    --auth-text: #0f172a;
    --auth-text-soft: #475569;
    --auth-muted: #64748b;
  
    --auth-border: rgba(148, 163, 184, 0.22);
    --auth-border-strong: rgba(99, 102, 241, 0.22);
    --auth-surface: rgba(255, 255, 255, 0.82);
    --auth-surface-solid: #ffffff;
    --auth-surface-soft: #f8fafc;
  
    --auth-shadow-xl: 0 30px 80px rgba(15, 23, 42, 0.16);
    --auth-shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.1);
    --auth-shadow-md: 0 12px 30px rgba(15, 23, 42, 0.08);
    --auth-radius-xl: 30px;
    --auth-radius-lg: 22px;
    --auth-radius-md: 16px;
    --auth-radius-sm: 12px;
  
    --auth-success-bg: rgba(16, 185, 129, 0.12);
    --auth-success-border: rgba(16, 185, 129, 0.24);
    --auth-success-text: #047857;
  
    --auth-error-bg: rgba(239, 68, 68, 0.12);
    --auth-error-border: rgba(239, 68, 68, 0.24);
    --auth-error-text: #b91c1c;
  
    --auth-info-bg: rgba(59, 130, 246, 0.12);
    --auth-info-border: rgba(59, 130, 246, 0.22);
    --auth-info-text: #1d4ed8;
  
    --auth-warning-bg: rgba(245, 158, 11, 0.12);
    --auth-warning-border: rgba(245, 158, 11, 0.24);
    --auth-warning-text: #b45309;
  
    --auth-transition: 180ms ease;
  }

  @keyframes authFadeUp {
    from {
      opacity: 0;
      transform: translateY(24px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes authFadeLeft {
    from {
      opacity: 0;
      transform: translateX(-32px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  @keyframes authFadeRight {
    from {
      opacity: 0;
      transform: translateX(32px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  @keyframes authSoftPulse {
    0% {
      transform: scale(1);
      opacity: 0.16;
    }
    50% {
      transform: scale(1.08);
      opacity: 0.24;
    }
    100% {
      transform: scale(1);
      opacity: 0.16;
    }
  }
  
  @keyframes authFloatY {
    0% {
      transform: translateY(0px);
    }
    50% {
      transform: translateY(-10px);
    }
    100% {
      transform: translateY(0px);
    }
  }
  
  @keyframes authPanelReveal {
    from {
      opacity: 0;
      transform: translateY(18px) scale(0.985);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
  
  @keyframes authTabSwitchIn {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes authGlowShift {
    0% {
      transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
      transform: translate3d(12px, -8px, 0) scale(1.04);
    }
    100% {
      transform: translate3d(0, 0, 0) scale(1);
    }
  }
  
  @keyframes authSlideIn {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes authSlideOut {
    from {
      opacity: 1;
      transform: translateY(0);
      max-height: 240px;
    }
    to {
      opacity: 0;
      transform: translateY(-6px);
      max-height: 0;
      margin-bottom: 0;
      padding-top: 0;
      padding-bottom: 0;
    }
  }
  
  html,
  body {
    margin: 0;
    padding: 0;
  }
  
  body.auth-page {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--auth-text);
    background:
      radial-gradient(circle at top left, rgba(99, 102, 241, 0.16), transparent 32%),
      radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.12), transparent 28%),
      linear-gradient(135deg, var(--auth-bg-1) 0%, var(--auth-bg-2) 50%, var(--auth-bg-3) 100%);
  }

  .auth-language-switcher {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
  }
  
  .auth-language-switcher__label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--auth-text-soft);
    letter-spacing: -0.01em;
  }
  
  .nmf-language-switcher--auth {
    min-width: 186px;
  }
  
  .nmf-language-switcher--auth .nmf-language-switcher__trigger {
    min-height: 44px;
    background: rgba(255,255,255,0.88);
    border-color: var(--auth-border);
  }
  
  .nmf-language-switcher--auth .nmf-language-switcher__panel {
    background: rgba(255,255,255,0.94);
    border-color: rgba(148, 163, 184, 0.18);
  }
  
  .auth-shell {
    min-height: 100vh;
    width: 100%;
    display: block;
    padding: 0;
    margin: 0;
    position: relative;
    overflow: hidden;
  }
  
  .auth-shell::before,
  .auth-shell::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(40px);
  }
  
  .auth-shell::before {
    width: 360px;
    height: 360px;
    top: -120px;
    left: -100px;
    background: rgba(99, 102, 241, 0.16);
    animation: authSoftPulse 8s ease-in-out infinite;
  }
  
  .auth-shell::after {
    width: 320px;
    height: 320px;
    right: -90px;
    bottom: -110px;
    background: rgba(139, 92, 246, 0.15);
    animation: authSoftPulse 10s ease-in-out infinite;
  }
  
  .auth-layout {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 0;
    align-items: stretch;
    position: relative;
    z-index: 1;
  }
  
  .auth-brand-panel {
    position: relative;
    min-height: 100vh;
    padding: 64px 56px;
    border-radius: 0;
    background:
      radial-gradient(circle at top left, rgba(255,255,255,0.14), transparent 28%),
      linear-gradient(160deg, rgba(79, 70, 229, 0.96), rgba(124, 58, 237, 0.92));
    color: #fff;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: authFadeLeft 0.8s ease both;
  }
  
  .auth-brand-panel::before {
    content: "";
    position: absolute;
    inset: auto -50px -50px auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    filter: blur(8px);
  }
  
  .auth-brand-badge {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 56px;
    margin-bottom: 20px;
    overflow: visible;
  }

  .auth-logo {
    display: block;
    width: auto;
    max-width: 220px;
    height: 48px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
    transition: transform 0.3s ease;
  }

  .auth-logo:hover {
    transform: scale(1.05);
  }
  
  .auth-brand-title {
    margin: 0 0 12px;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #e8e6fd;
    animation: authFadeUp 0.9s ease both;
  }
  
  .auth-brand-copy {
    margin: 0 0 28px;
    color: rgba(255,255,255,0.86);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 34ch;
    animation: authFadeUp 1.05s ease both;
  }
  
  .auth-brand-points {
    display: grid;
    gap: 12px;
    margin-bottom: 26px;
    animation: authFadeUp 1.2s ease both;
  }
  
  .auth-brand-point {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(8px);
    animation: authFloatY 6s ease-in-out infinite;
  }
  
  .auth-brand-point:nth-child(2) {
    animation-delay: 0.6s;
  }
  
  .auth-brand-point:nth-child(3) {
    animation-delay: 1.2s;
  }
  
  .auth-brand-point-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.14);
    font-size: 0.95rem;
  }
  
  .auth-brand-point strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
  }
  
  .auth-brand-point span {
    display: block;
    font-size: 0.86rem;
    color: rgba(255,255,255,0.82);
    line-height: 1.5;
  }
  
  .auth-brand-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.16);
    font-size: 0.82rem;
    color: rgba(255,255,255,0.9);
  }
  
  .auth-panel {
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.78);
    border: 0;
    backdrop-filter: blur(22px);
    border-radius: 0;
    box-shadow: none;
    padding: 64px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: authFadeRight 0.8s ease both;
  }

  .auth-panel-inner {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
  }
  
  .auth-panel-header {
    margin-bottom: 22px;
    animation: authFadeUp 0.9s ease both;
  }
  
  .auth-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--auth-primary);
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  
  .auth-panel-title {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 2vw, 2.3rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--auth-text);
  }
  
  .auth-panel-subtitle {
    margin: 0;
    color: var(--auth-text-soft);
    font-size: 0.98rem;
    line-height: 1.7;
  }
  
  .auth-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--auth-border);
    margin: 24px 0 24px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
    animation: authFadeUp 1.05s ease both;
  }
  
  .auth-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    border-radius: 14px;
    padding: 14px 12px;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--auth-transition), color var(--auth-transition), transform var(--auth-transition), box-shadow var(--auth-transition);
  }
  
  .auth-tab:hover {
    color: var(--auth-text);
    background: rgba(255,255,255,0.74);
  }
  
  .auth-tab.active,
  .auth-tab[aria-selected="true"] {
    color: var(--auth-primary);
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
  }
  
  .auth-tab-content {
    display: none !important;
  }
  
  .auth-tab-content.active {
    display: block !important;
    animation: authTabSwitchIn 0.24s ease;
  }
  
  .auth-form {
    display: grid;
    gap: 18px;
  }
  
  .form-group {
    margin: 0;
  }
  
  .form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--auth-text);
  }
  
  .form-help {
    margin-top: 8px;
    font-size: 0.84rem;
    color: var(--auth-muted);
    line-height: 1.5;
  }
  
  .form-error {
    margin-top: 8px;
    font-size: 0.84rem;
    color: var(--auth-error-text);
    font-weight: 600;
  }
  
  .form-input,
  .form-input:focus,
  .form-input:active {
    box-sizing: border-box;
  }
  
  .form-input {
    width: 100%;
    height: 56px;
    border-radius: 16px;
    border: 1px solid var(--auth-border);
    background: rgba(255,255,255,0.92);
    padding: 0 16px;
    font-size: 0.96rem;
    color: var(--auth-text);
    outline: none;
    transition:
      border-color var(--auth-transition),
      box-shadow var(--auth-transition),
      background var(--auth-transition),
      transform var(--auth-transition);
    box-shadow: 0 1px 2px rgba(15,23,42,0.02);
  }
  
  .form-input:hover {
    border-color: rgba(99, 102, 241, 0.18);
    transform: translateY(-1px);
  }
  
  .form-input:focus {
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
  }
  
  .form-input::placeholder {
    color: #94a3b8;
  }
  
  .form-input:hover {
    border-color: rgba(99, 102, 241, 0.18);
  }
  
  .form-input:focus {
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  }
  
  .password-input-wrapper {
    position: relative;
  }
  
  .password-input-wrapper .form-input {
    padding-right: 56px;
  }
  
  .password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
    transition: background var(--auth-transition), color var(--auth-transition);
  }
  
  .password-toggle:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--auth-primary);
  }
  
  .auth-submit {
    width: 100%;
    min-height: 58px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-secondary) 100%);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 18px 36px rgba(99, 102, 241, 0.24);
    transition:
      transform var(--auth-transition),
      box-shadow var(--auth-transition),
      filter var(--auth-transition);
    position: relative;
    overflow: hidden;
  }
  
  .auth-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      120deg,
      transparent 0%,
      rgba(255,255,255,0.14) 30%,
      rgba(255,255,255,0.32) 50%,
      transparent 70%
    );
    transform: translateX(-120%);
    transition: transform 0.7s ease;
  }
  
  .auth-submit:hover::before {
    transform: translateX(120%);
  }
  
  .auth-submit:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 24px 46px rgba(99, 102, 241, 0.28);
    filter: saturate(1.08);
  }
  
  .auth-submit:active {
    transform: translateY(0);
  }
  
  .auth-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
  }
  
  .password-rules {
    margin-top: 10px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid var(--auth-border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
  }
  
  .password-rule {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    font-size: 0.84rem;
    line-height: 1.45;
  }
  
  .password-rule .rule-icon {
    width: 18px;
    display: inline-flex;
    justify-content: center;
    flex-shrink: 0;
  }
  
  .password-rule.rule-valid {
    color: var(--auth-success-text);
    font-weight: 600;
  }
  
  .auth-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148,163,184,0.35), transparent);
    margin: 24px 0 20px;
  }
  
  .auth-trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .auth-trust-card {
    padding: 14px 12px;
    border-radius: 16px;
    border: 1px solid var(--auth-border);
    background: rgba(255,255,255,0.62);
    text-align: center;
    transition: transform var(--auth-transition), box-shadow var(--auth-transition), border-color var(--auth-transition);
  }
  
  .auth-trust-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
    border-color: rgba(99, 102, 241, 0.22);
  }
  
  .auth-trust-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    color: var(--auth-text);
  }
  
  .auth-trust-card span {
    display: block;
    font-size: 0.77rem;
    line-height: 1.4;
    color: var(--auth-muted);
  }
  
  .auth-footer-note {
    margin-top: 18px;
    text-align: center;
    font-size: 0.84rem;
    color: var(--auth-muted);
    line-height: 1.5;
  }
  
  .auth-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 700;
  }
  
  .auth-link:hover {
    color: var(--auth-primary-dark);
  }
  
  .auth-alert-container {
    min-height: 0;
  }
  
  .auth-alert {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 16px 16px 14px;
    margin-bottom: 18px;
    border-radius: 18px;
    border: 1px solid transparent;
    box-shadow: var(--auth-shadow-md);
    animation: authSlideIn 0.22s ease;
  }
  
  .auth-alert--success {
    background: var(--auth-success-bg);
    border-color: var(--auth-success-border);
    color: var(--auth-success-text);
  }
  
  .auth-alert--error {
    background: var(--auth-error-bg);
    border-color: var(--auth-error-border);
    color: var(--auth-error-text);
  }
  
  .auth-alert--info {
    background: var(--auth-info-bg);
    border-color: var(--auth-info-border);
    color: var(--auth-info-text);
  }
  
  .auth-alert--warning {
    background: var(--auth-warning-bg);
    border-color: var(--auth-warning-border);
    color: var(--auth-warning-text);
  }
  
  .auth-alert__icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,0.75);
    font-weight: 800;
    font-size: 0.95rem;
  }
  
  .auth-alert__content {
    flex: 1;
    min-width: 0;
  }
  
  .auth-alert__message {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.5;
  }
  
  .auth-alert__details {
    margin-top: 8px;
  }
  
  .auth-alert__details ul {
    margin: 0;
    padding-left: 18px;
  }
  
  .auth-alert__details li {
    margin: 3px 0;
    font-size: 0.84rem;
    line-height: 1.45;
  }
  
  .auth-alert__close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.15rem;
    cursor: pointer;
    opacity: 0.7;
  }
  
  .auth-alert__close:hover {
    opacity: 1;
  }
  
  .auth-alert--dismissing {
    animation: authSlideOut 0.22s ease forwards;
  }
  
  .reset-back-link {
    margin-top: 18px;
    text-align: center;
  }
  
  .reset-invalid {
    text-align: center;
  }
  
  .reset-invalid .auth-submit {
    max-width: 220px;
  }
  
  @media (max-width: 1024px) {
    .auth-layout {
      grid-template-columns: 1fr;
      min-height: 100vh;
    }
  
    .auth-brand-panel {
      min-height: auto;
      padding: 40px 24px 28px;
    }
  
    .auth-panel {
      min-height: auto;
      padding: 32px 24px 40px;
    }
  
    .auth-panel-inner {
      max-width: 100%;
    }
  }

  @media (max-width: 768px) {
    .auth-logo {
      max-width: 170px;
      height: 40px;
    }
  }
  
  @media (max-width: 640px) {
    .auth-shell {
      padding: 0;
    }
  
    .auth-brand-panel,
    .auth-panel {
      padding-left: 18px;
      padding-right: 18px;
    }
  
    .auth-tabs {
      grid-template-columns: 1fr;
    }
  
    .password-rules,
    .auth-trust-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation: none !important;
      transition: none !important;
      scroll-behavior: auto !important;
    }
  }