/* === auth/login.html === */
html:has(.auth-page),
  body:has(.auth-page) {
    width: 100%;
    min-height: 100dvh;
    overflow-x: hidden !important;
    overscroll-behavior-x: none;
  }

  body:has(.auth-page) {
    margin: 0;
  }

  body.no-navbar .auth-page {
    height: calc(100dvh - var(--app-status-height, 0px) - var(--app-footer-height, 0px));
    max-height: calc(100dvh - var(--app-status-height, 0px) - var(--app-footer-height, 0px));
  }

  body.no-navbar .auth-container {
    height: min(370px, calc(100dvh - var(--app-status-height, 0px) - var(--app-footer-height, 0px) - 1rem));
  }

  body:has(.auth-page) main,
  body:has(.auth-page) .container,
  body:has(.auth-page) .container-fluid {
    min-height: 0 !important;
    overflow: visible !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }


  .auth-page {
    height: calc(100dvh - var(--app-status-height, 0px) - var(--app-navbar-height, 0px) - var(--app-footer-height, 0px));
    max-height: calc(100dvh - var(--app-status-height, 0px) - var(--app-navbar-height, 0px) - var(--app-footer-height, 0px));
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: .5rem;
    background:
      radial-gradient(circle at top left, rgba(212, 175, 55, .13), transparent 28%),
      linear-gradient(135deg, #f4f7fb, #eef3f8);
  }

  .auth-container {
    position: relative;
    width: min(760px, 94vw);
    height: min(370px, calc(100dvh - var(--app-status-height, 0px) - var(--app-navbar-height, 0px) - var(--app-footer-height, 0px) - 1rem));
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--fedha-border, #e2e8f0);
    box-shadow: 0 18px 44px rgba(11, 29, 58, .14);
    transform: translateY(0);
  }

  .form-container {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    transition:
      transform .55s cubic-bezier(.22, 1, .36, 1),
      opacity .4s ease;
  }

  .form-container form {
    height: 100%;
    padding: 2.35rem 1.6rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }

  .form-container h1 {
    color: var(--fedha-navy, #0b1d3a);
    font-weight: 800;
    font-size: 1.45rem;
    margin-bottom: .25rem;
  }

  .form-container p {
    color: var(--fedha-muted, #64748b);
    text-align: center;
    margin-bottom: .9rem;
    font-size: .82rem;
    line-height: 1.4;
  }

  .form-container input,
  .form-container select,
  .password-wrap {
    width: 100%;
    border: 1px solid var(--fedha-border-strong, #cbd5e1);
    background: var(--fedha-surface-soft, #f8fafc);
    border-radius: 8px;
    padding: .58rem .72rem;
    margin-bottom: .55rem;
    font-size: .86rem;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
  }

  .password-wrap {
    display: flex;
    align-items: center;
    padding: 0;
    overflow: hidden;
  }

  .password-wrap input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    margin: 0 !important;
    padding: .58rem .72rem !important;
    background: transparent;
    box-shadow: none !important;
  }

  .password-wrap input:focus {
    box-shadow: none !important;
  }

  .password-toggle {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 3.4rem;
    height: 100%;
    border: 0 !important;
    background: transparent !important;
    color: var(--fedha-navy, #0b1d3a) !important;
    padding: 0 .7rem !important;
    margin: 0 !important;
    font-size: .72rem !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .025em;
    box-shadow: none !important;
    transform: none !important;
  }

  .password-toggle:hover {
    color: var(--fedha-gold-dark, #b88a13) !important;
  }

  .form-container input:focus,
  .form-container select:focus,
  .password-wrap:focus-within {
    background: #fff;
    border-color: var(--fedha-gold, #d4af37);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .2);
  }

  .submit-btn,
  .ghost,
  .mobile-switch button {
    border: 0;
    border-radius: 8px;
    padding: .58rem 1rem;
    background: var(--fedha-gold, #d4af37);
    color: var(--fedha-navy, #0b1d3a);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
    cursor: pointer;
  }

  .submit-btn {
    width: 100%;
    margin-top: .1rem;
  }

  .submit-btn:hover {
    background: var(--fedha-gold-dark, #b88a13);
    color: #fff;
    transform: translateY(-1px);
  }

  .submit-btn:disabled {
    cursor: wait;
    opacity: .72;
    transform: none;
  }

  .submit-btn.is-loading::after {
    content: "";
    display: inline-block;
    width: .72rem;
    height: .72rem;
    margin-left: .45rem;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -0.12rem;
    animation: spin .7s linear infinite;
  }

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

  .sign-in {
    left: 0;
    z-index: 2;
  }

  .sign-up {
    left: 0;
    opacity: 0;
    z-index: 1;
  }

  .auth-container.active .sign-in {
    transform: translateX(100%);
    opacity: 0;
  }

  .auth-container.active .sign-up {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
  }

  .toggle-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition:
      transform .55s cubic-bezier(.22, 1, .36, 1),
      border-radius .55s cubic-bezier(.22, 1, .36, 1);
    border-radius: 70px 0 0 70px;
    z-index: 10;
  }

  .auth-container.active .toggle-container {
    transform: translateX(-100%);
    border-radius: 0 70px 70px 0;
  }

  .toggle {
    position: relative;
    left: -100%;
    width: 200%;
    height: 100%;
    color: #fff;
    background:
      radial-gradient(circle at top right, rgba(212, 175, 55, .20), transparent 30%),
      linear-gradient(145deg, var(--fedha-navy-dark, #07142a), var(--fedha-navy, #0b1d3a));
    transform: translateX(0);
    transition: transform .55s cubic-bezier(.22, 1, .36, 1);
  }

  .auth-container.active .toggle {
    transform: translateX(50%);
  }

  .toggle-panel {
    position: absolute;
    width: 50%;
    height: 100%;
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform .55s cubic-bezier(.22, 1, .36, 1);
  }

  .toggle-panel::before {
    content: "";
    position: absolute;
    width: 115px;
    height: 115px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    top: -38px;
    right: -38px;
  }

  .toggle-panel h1,
  .toggle-panel p,
  .toggle-panel button,
  .brand {
    position: relative;
    z-index: 1;
  }

  .toggle-panel h1 {
    font-size: 1.35rem;
    font-weight: 850;
    letter-spacing: -.035em;
    margin-bottom: .55rem;
    color: #ffffff !important;
  }

  .toggle-panel .brand {
    color: #ffffff !important;
  }

  .toggle-panel p {
    max-width: 220px;
    color: rgba(255,255,255,.82);
    line-height: 1.45;
    margin-bottom: .95rem;
    font-size: .82rem;
  }

  .brand {
    font-size: 1rem;
    font-weight: 900;
    margin-bottom: 1rem;
  }

  .brand span {
    color: var(--fedha-gold, #d4af37);
  }

  .ghost {
    background: transparent;
    border: 1px solid rgba(212,175,55,.78);
    color: #ffffff;
  }

  .ghost:hover {
    background: var(--fedha-gold, #d4af37);
    color: var(--fedha-navy, #0b1d3a);
  }

  .toggle-left {
    transform: translateX(-200%);
  }

  .auth-container.active .toggle-left {
    transform: translateX(0);
  }

  .toggle-right {
    right: 0;
    transform: translateX(0);
  }

  .auth-container.active .toggle-right {
    transform: translateX(200%);
  }

  .mobile-switch {
    display: none;
  }

  @media (max-width: 820px) {
    body.no-navbar .auth-page {
      height: calc(100dvh - var(--app-status-height, 0px) - var(--app-footer-height, 0px));
      max-height: calc(100dvh - var(--app-status-height, 0px) - var(--app-footer-height, 0px));
    }

    body.no-navbar .auth-container {
      height: min(430px, calc(100dvh - var(--app-status-height, 0px) - var(--app-footer-height, 0px) - 1rem));
    }
    .auth-page {
      height: calc(100dvh - var(--app-status-height, 0px) - var(--app-navbar-height, 0px) - var(--app-footer-height, 0px));
      max-height: calc(100dvh - var(--app-status-height, 0px) - var(--app-navbar-height, 0px) - var(--app-footer-height, 0px));
      min-height: 0;
      padding: .5rem;
      overflow: hidden;
    }

    .auth-container {
      width: min(430px, 96vw);
      height: min(430px, calc(100dvh - var(--app-status-height, 0px) - var(--app-navbar-height, 0px) - var(--app-footer-height, 0px) - 1rem));
      border-radius: 16px;
      padding-bottom: 54px;
      transform: translateY(0);
    }

    .toggle-container {
      display: none;
    }

    .form-container {
      width: 100%;
      height: calc(100% - 54px);
    }

    .form-container form {
      padding: 1.7rem 1.25rem .9rem;
    }

    .sign-up {
      transform: translateX(100%);
    }

    .auth-container.active .sign-in {
      transform: translateX(-100%);
      opacity: 0;
    }

    .auth-container.active .sign-up {
      transform: translateX(0);
      opacity: 1;
    }

    .mobile-switch {
      position: absolute;
      left: .75rem;
      right: .75rem;
      bottom: .75rem;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: .5rem;
      z-index: 20;
    }

    .mobile-switch button {
      padding: .62rem .5rem;
      font-size: .7rem;
    }

    .mobile-switch button:first-child {
      background: var(--fedha-gold-soft, #fff7d6);
      color: var(--fedha-navy, #0b1d3a);
    }

    .auth-container.active .mobile-switch button:first-child {
      background: var(--fedha-gold-soft, #fff7d6);
      color: var(--fedha-navy, #0b1d3a);
    }

    .auth-container.active .mobile-switch button:last-child {
      background: var(--fedha-gold, #d4af37);
      color: var(--fedha-navy, #0b1d3a);
    }

    .auth-container:not(.active) .mobile-switch button:first-child {
      background: var(--fedha-gold, #d4af37);
      color: var(--fedha-navy, #0b1d3a);
    }

    .auth-container:not(.active) .mobile-switch button:last-child {
      background: var(--fedha-gold-soft, #fff7d6);
      color: var(--fedha-navy, #0b1d3a);
    }
  }

  @media (max-height: 620px) and (orientation: landscape) {
    body.no-navbar .auth-container {
      height: min(320px, calc(100dvh - var(--app-status-height, 0px) - var(--app-footer-height, 0px) - 1rem));
    }
    .auth-page {
      overflow: hidden;
      padding: .5rem;
    }

    .auth-container {
      height: min(320px, calc(100dvh - var(--app-status-height, 0px) - var(--app-navbar-height, 0px) - var(--app-footer-height, 0px) - 1rem));
      transform: translateY(0);
    }

    .form-container form {
      padding: 2rem 1.25rem 1rem;
    }

    .form-container h1 {
      font-size: 1.25rem;
    }

    .form-container p {
      margin-bottom: .55rem;
    }

    .form-container input,
    .form-container select {
      padding: .5rem .65rem;
      margin-bottom: .42rem;
    }

    .password-wrap input {
      padding: .5rem .65rem !important;
      margin-bottom: 0 !important;
    }

    .toggle-panel h1 {
      font-size: 1.25rem;
    }

    .toggle-panel p {
      margin-bottom: .7rem;
    }
  }
