html {
      min-height: 100%;
    }

    body {
      font-family: 'Inter', sans-serif;
      /* Match login.html behavior */
      background-size: 400% 400%;
      animation: gradient-animation 15s ease infinite;
      /* Ensure full viewport coverage across mobile browsers */
      min-height: 100vh;
      min-height: 100svh;
      min-height: 100dvh;
      min-height: 100lvh;
      min-height: calc(var(--vh, 1vh) * 100);
    }

    @keyframes gradient-animation {
      0% {
        background-position: 0% 50%;
      }

      50% {
        background-position: 100% 50%;
      }

      100% {
        background-position: 0% 50%;
      }
    }

    /* Same gradient token used in login.html */
    .body-bg-default {
      background: linear-gradient(135deg, #eaf3ff, #dbeafe, #e0f2fe, #e6fffa);
    }

    .bg-logo-blue {
      background-color: #1e3a8a;
    }

    .text-logo-blue {
      color: #1e3a8a;
    }

    .text-logo-green {
      color: #16a34a;
    }

    /* Use a simple font for English brand name */
    .brand-en {
      font-family: 'Inter', system-ui, sans-serif;
    }

    /* Use Mirza for Arabic text */
    [lang="ar"] {
      font-family: 'Traditional Arabic', 'Amiri', 'Mirza', 'Noto Sans Arabic', 'Tahoma', serif;
      color: #16a34a;
    }

    /* Root bg to avoid white during overscroll and URL bar collapse on mobile */
    :root {
      --vh: 1vh;
    }

    html {
      /* Use the same base gradient as body to avoid any edge mismatch */
      background: linear-gradient(135deg, #eaf3ff, #dbeafe, #e0f2fe, #e6fffa);
      background-color: #eaf3ff;
      /* fallback */
      margin: 0;
      overflow-x: hidden;
    }

    /* Avoid bounce overscroll revealing any edge */
    html,
    body {
      overscroll-behavior: contain;
    }

    /* Background gradient + subtle motion */
    .bg-gradient-login {
      background: radial-gradient(1000px 500px at -10% -10%, rgba(30, 58, 138, 0.12), transparent 60%),
        radial-gradient(800px 400px at 110% 10%, rgba(22, 163, 74, 0.12), transparent 60%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
      /* Fallback for older browsers */
      min-height: 100vh;
      /* JS-driven fallback for mobile browsers with inconsistent vh */
      min-height: calc(var(--vh, 1vh) * 100);
      /* New viewport units for better mobile behavior */
      min-height: 100svh;
      /* stable viewport height */
      min-height: 100dvh;
      /* dynamic viewport height (Chrome, modern) */
    }

    /* iOS/WebKit fallback to ensure element can grow to full viewport */
    @supports not (height: 100dvh) {

      html,
      body {
        height: -webkit-fill-available;
      }

      .bg-gradient-login {
        min-height: -webkit-fill-available;
      }
    }

    /* Glass card feel */
    .glass-card {
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.98));
      border: 1px solid rgba(15, 23, 42, 0.06);
      box-shadow: 0 18px 40px rgba(2, 6, 23, 0.12), 0 2px 8px rgba(2, 6, 23, 0.05);
    }

    /* Fancy tab states re-using the existing bg-gray-100 active toggle */
    .tab-switch button {
      border-radius: 9999px;
      transition: all .2s ease;
    }

    .tab-switch button.bg-gray-100 {
      background: linear-gradient(180deg, #ffffff, #eef2ff);
      color: #1e3a8a;
      box-shadow: 0 8px 22px rgba(30, 58, 138, 0.15);
    }

    /* Input polish */
    .input-decor {
      border: 1px solid #e5e7eb;
      background: #fff;
      transition: box-shadow .15s ease, border-color .15s ease;
    }

    .input-decor:focus {
      outline: none;
      border-color: #93c5fd;
      box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    }

    /* Buttons */
    .btn-primary-grad {
      background: linear-gradient(135deg, #1e3a8a, #3b82f6);
      color: #fff;
    }

    .btn-primary-grad:hover {
      filter: brightness(1.05);
      transform: translateY(-1px);
    }

    .btn-primary-grad:active {
      transform: translateY(0);
    }

    /* Button inline spinner */
    .btn-spinner {
      width: 1rem;
      height: 1rem;
      border-radius: 9999px;
      border: 2px solid rgba(255, 255, 255, 0.35);
      border-top-color: #fff;
      border-right-color: #fff;
      animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    /* Use simple font for Dar al-Ilm */
    .font-greyqo {
      font-family: 'Grechen Fuemen', cursive, 'Inter', system-ui, sans-serif;
      font-style: italic;
    }

    /* Decorative floaters */
    @keyframes floaty {

      0%,
      100% {
        transform: translateY(0)
      }

      50% {
        transform: translateY(-6px)
      }
    }

    .floaty {
      animation: floaty 4s ease-in-out infinite;
    }

    @media (prefers-reduced-motion: reduce) {
      .floaty {
        animation: none
      }
    }

    /* Falling letters animation for Dar al-Ilm */
    .fall-letter {
      display: inline-block;
      opacity: 0;
      transform: translateY(-42px) rotate(-3deg);
      animation: fall-in 600ms cubic-bezier(.16, 1, .3, 1) forwards;
    }

    .fall-letter:nth-child(odd) {
      transform: translateY(-54px) rotate(3deg);
    }

    @keyframes fall-in {
      60% {
        opacity: 1;
        transform: translateY(6px) rotate(0deg);
      }

      100% {
        opacity: 1;
        transform: translateY(0) rotate(0);
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .fall-letter {
        animation: none;
        opacity: 1;
        transform: none
      }
    }

    /* Prevent 1px seam at the bottom on some GPUs */
    main {
      padding-bottom: 1px;
    }

    /* Pure CSS toggle switch — no Tailwind peer utilities needed */
    .toggle-switch {
      -webkit-appearance: none;
      appearance: none;
      width: 36px;
      height: 20px;
      background: #d1d5db;
      border-radius: 9999px;
      position: relative;
      cursor: pointer;
      flex-shrink: 0;
      transition: background 0.2s ease;
      outline-offset: 2px;
    }

    .toggle-switch::before {
      content: '';
      position: absolute;
      width: 16px;
      height: 16px;
      background: #fff;
      border-radius: 50%;
      top: 2px;
      left: 2px;
      transition: transform 0.2s ease;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    }

    .toggle-switch:checked {
      background: #1e3a8a;
    }

    .toggle-switch:checked::before {
      transform: translateX(16px);
    }

    .toggle-switch:focus-visible {
      outline: 2px solid #3b82f6;
    }
