 :root {
      --color-primary: #64748b;
      --color-primary-dark: #475569;
      --gradient-primary: linear-gradient(135deg, #64748b 0%, #475569 100%);
      --color-page-bg: #f3f4f6;
      --color-surface: #ffffff;
      --color-text: #1f2937;
      --color-text-muted: #6b7280;
      --color-border: #e5e7eb;
      --radius-card: 16px;
      --radius-control: 8px;
      --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
      --font-sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      --topbar-height: 44px;
    }

    *,
    *::before,
    *::after {
      box-sizing: border-box;
    }

    html,
    body {
      height: 100%;
      margin: 0;
      overflow: hidden;
    }

    body {
      min-width: 0;
      font-family: var(--font-sans);
      font-weight: 400;
      color: var(--color-text);
      background: var(--color-page-bg);
      -webkit-font-smoothing: antialiased;
    }

    .page {
      display: flex;
      height: 100%;
      max-height: 100%;
      flex-direction: column;
      overflow: hidden;
    }

    .topbar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 10;
      display: flex;
      align-items: center;
      justify-content: space-between;
      box-sizing: border-box;
      height: var(--topbar-height);
      padding: 0 24px;
      border-bottom: 1px solid rgba(229, 231, 235, 0.6);
      background: rgba(255, 255, 255, 0.72);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    .topbar__brand {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      font-weight: 600;
      color: var(--color-text);
      letter-spacing: -0.01em;
      white-space: nowrap;
    }

    .topbar__brand img {
      flex-shrink: 0;
      display: block;
      width: 18px;
      height: 18px;
      object-fit: contain;
    }

    .topbar__meta {
      font-size: 12px;
      font-weight: 500;
      color: var(--color-text-muted);
      white-space: nowrap;
    }

    .split {
      display: flex;
      flex: 1 1 0;
      min-height: 0;
      padding-top: var(--topbar-height);
      box-sizing: border-box;
    }

    .brand-panel {
      flex: 0 0 50%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: 16px 28px;
      background: var(--gradient-primary);
      position: relative;
      min-height: 0;
      overflow: hidden;
    }

    .brand-panel::before {
      content: "";
      position: absolute;
      inset: 0;
      background-image: radial-gradient(
          circle at 20% 30%,
          rgba(255, 255, 255, 0.12) 0%,
          transparent 45%
        ),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
      pointer-events: none;
    }

    .brand-panel__inner {
      position: relative;
      z-index: 1;
      text-align: center;
      max-width: 420px;
    }

    .brand-panel__logo {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 64px;
      height: 64px;
      margin-bottom: 14px;
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(255, 255, 255, 0.22);
      color: #ffffff;
    }

    .brand-panel__logo img {
      display: block;
      width: 48px;
      height: 48px;
      object-fit: contain;
    }

    .brand-panel__title {
      margin: 0 0 6px;
      font-size: 24px;
      font-weight: 600;
      line-height: 1.2;
      letter-spacing: -0.02em;
      color: #ffffff;
    }

    .brand-panel__tagline {
      margin: 0;
      font-size: 14px;
      font-weight: 400;
      line-height: 1.4;
      color: rgba(255, 255, 255, 0.88);
    }

    .form-panel {
      flex: 0 0 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 12px 24px;
      min-height: 0;
      background: var(--color-page-bg);
    }

    .card {
      width: 420px;
      flex-shrink: 0;
      padding: 22px 28px;
      overflow: hidden;
      background: var(--color-surface);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-card);
      box-shadow: var(--shadow-card);
      animation: cardFadeIn 0.4s ease forwards;
      opacity: 0;
      transform: translateY(6px);
    }

    @keyframes cardFadeIn {
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .card__header {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      text-align: center;
      gap: 8px;
    }

    .card__icon {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      margin: 0;
      color: var(--color-primary);
    }

    .card__icon img {
      display: block;
      width: 22px;
      height: 22px;
      object-fit: contain;
    }

    .card__heading {
      margin: 0;
      font-size: 20px;
      font-weight: 600;
      letter-spacing: -0.02em;
      color: var(--color-text);
    }

    .field {
      margin-bottom: 12px;
    }

    .field label {
      display: block;
      margin-bottom: 5px;
      font-size: 13px;
      font-weight: 500;
      color: var(--color-text);
    }

    .input-wrap {
      position: relative;
    }

    .input-wrap input[type="email"],
    .input-wrap input[type="password"],
    .input-wrap input[type="text"] {
      width: 100%;
      height: 42px;
      padding: 0 12px;
      font-family: var(--font-sans);
      font-size: 14px;
      font-weight: 400;
      color: var(--color-text);
      background: var(--color-surface);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-control);
      outline: none;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .input-wrap input[type="password"],
    .input-wrap input[type="text"]#password {
      padding-right: 48px;
    }

    .input-wrap input[type="email"]::placeholder,
    .input-wrap input[type="password"]::placeholder,
    .input-wrap input[type="text"]::placeholder {
      color: #9ca3af;
    }

    .input-wrap input[type="email"]:focus,
    .input-wrap input[type="password"]:focus,
    .input-wrap input[type="text"]:focus {
      border-color: var(--color-primary);
      box-shadow: 0 0 0 2px #64748b, 0 0 0 6px rgba(100, 116, 139, 0.15);
    }

    /*
      Show/hide password: icons toggle via adjacent sibling selector.
      The actual text reveal is handled by JS changing input type.
    */
    .password-toggle-wrap {
      position: absolute;
      top: 50%;
      right: 6px;
      transform: translateY(-50%);
      display: flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      cursor: pointer;
      z-index: 5;
    }

    .password-checkbox {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      z-index: 2;
      margin: 0 !important;
    }

    .password-toggle-icons {
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--color-text-muted);
      transition: color 0.2s ease;
    }

    .icon-eye-off {
      display: none;
    }

    .password-checkbox:checked + .password-toggle-icons .icon-eye {
      display: none;
    }

    .password-checkbox:checked + .password-toggle-icons .icon-eye-off {
      display: block;
    }

    .remember {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 2px 0 14px;
    }

    .remember input[type="checkbox"] {
      width: 16px;
      height: 16px;
      margin: 0;
      accent-color: var(--color-primary);
      cursor: pointer;
    }

    .remember label {
      margin: 0;
      font-size: 13px;
      font-weight: 500;
      color: var(--color-text-muted);
      cursor: pointer;
      transition: color 0.2s ease;
    }

    .remember:hover label {
      color: var(--color-text);
    }

    .button-group {
      display: flex;
      gap: 12px;
      margin: 16px 0 14px;
    }

    .btn-submit {
      flex: 1;
      height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 0 16px;
      font-family: var(--font-sans);
      font-size: 14px;
      font-weight: 600;
      letter-spacing: -0.01em;
      border-radius: var(--radius-control);
      cursor: pointer;
      transition: all 0.2s ease;
      border: 1px solid transparent;
    }

    .btn-primary {
      color: #ffffff;
      background: var(--gradient-primary);
      box-shadow: 0 4px 12px rgba(100, 116, 139, 0.2);
    }

    .btn-primary:hover {
      filter: brightness(1.1);
      transform: translateY(-1px);
      box-shadow: 0 6px 16px rgba(100, 116, 139, 0.3);
    }

    .btn-google {
      color: var(--color-text);
      background: #ffffff;
      border: 1px solid var(--color-border);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .btn-google:hover {
      background: #f8fafc;
      border-color: #cbd5e1;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .btn-submit:active {
      transform: translateY(0) scale(0.98);
    }

    .forgot-row {
      margin-top: 10px;
      text-align: right;
    }

    .forgot-row a {
      font-size: 13px;
      font-weight: 500;
      color: var(--color-primary);
      text-decoration: none;
      transition: color 0.2s ease, opacity 0.2s ease;
    }

    .forgot-row a:hover {
      color: var(--color-primary-dark);
    }

    .forgot-row a:active {
      opacity: 0.85;
    }

    .card__footer {
      margin-top: 14px;
      padding-top: 12px;
      border-top: 1px solid var(--color-border);
      font-size: 10px;
      line-height: 1.4;
      font-weight: 400;
      color: var(--color-text-muted);
      text-align: center;
    }

    /* Tablet — max-width: 1023px */
    @media (max-width: 1023px) {
      html,
      body {
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
        min-height: 100%;
      }

      body {
        min-width: 0;
      }

      .page {
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
        max-height: none;
        overflow: visible;
      }

      .brand-panel {
        display: none;
      }

      .split {
        flex-direction: column;
      }

      .form-panel {
        flex: 1 1 auto;
        width: 100%;
        max-width: none;
        padding: 24px 16px;
      }

      .card {
        width: 480px;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        padding: 32px;
      }

      .card__heading {
        font-size: 22px;
      }

      .card__heading h2 {
        margin-bottom: 80px;
      }

      .card__subheading {
        font-size: 14px;
      }

      .field label {
        font-size: 14px;
      }

      .input-wrap input[type="email"],
      .input-wrap input[type="password"],
      .input-wrap input[type="text"] {
        font-size: 16px;
        height: 46px;
      }

      .input-wrap input[type="email"]::placeholder,
      .input-wrap input[type="password"]::placeholder,
      .input-wrap input[type="text"]::placeholder {
        font-size: 14px;
      }

      .field {
        margin-bottom: 18px;
      }

      .btn-submit {
        height: 46px;
        min-height: 44px;
        font-size: 15px;
      }

      .card__footer {
        font-size: 11px;
      }

      :root {
        --topbar-height: calc(72px + env(safe-area-inset-top, 0px));
      }

      .topbar {
        height: auto;
        min-height: 0;
        padding: max(8px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 9px
          max(14px, env(safe-area-inset-left, 0px));
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 2px;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
        border-bottom: none;
      }

      .topbar::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 3px;
        background: var(--gradient-primary);
        pointer-events: none;
      }

      .topbar__brand {
        gap: 8px;
        font-size: 14px;
        line-height: 1.2;
        white-space: nowrap;
      }

      .topbar__brand img {
        width: 20px;
        height: 20px;
      }

      .topbar__meta {
        display: block;
        font-size: 11px;
        font-weight: 500;
        line-height: 1.3;
        color: var(--color-text-muted);
        letter-spacing: 0.01em;
        white-space: normal;
        max-width: 100%;
        padding-left: 28px;
        margin: 0;
      }
    }

    /* Mobile Large — max-width: 767px */
    @media (max-width: 767px) {
      html,
      body {
        overflow-x: hidden;
      }

      body {
        min-height: 100svh;
      }

      .page {
        min-height: 100svh;
        height: auto;
        max-height: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: var(--topbar-height);
        box-sizing: border-box;
        overflow: visible;
        background: var(--color-page-bg);
      }

      .split {
        flex: 0 0 auto;
        width: 100%;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-top: 0;
      }

      .form-panel {
        padding: 40px 16px;
        width: 100%;
        justify-content: center;
      }

      .card {
        width: 100%;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
        padding: 24px;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-card);
      }

      .card__heading {
        font-size: 19px;
      }

      .card__subheading {
        font-size: 13px;
      }

      .field label {
        font-size: 13px;
        margin-bottom: 4px;
      }

      .card__header {
        margin-bottom: 14px;
      }

      .field {
        margin-bottom: 12px;
      }

      .input-wrap input[type="email"],
      .input-wrap input[type="password"],
      .input-wrap input[type="text"] {
        height: 44px;
        padding: 0 12px;
        font-size: 16px;
      }

      .input-wrap input[type="password"],
      .input-wrap input[type="text"]#password {
        padding-right: 44px;
      }

      .btn-submit {
        height: 44px;
        min-height: 44px;
        font-size: 15px;
        border-radius: 10px;
        margin-top: 8px;
      }

      .remember {
        gap: 8px;
        margin: 0 0 10px;
        min-height: 44px;
        align-items: center;
      }

      .remember input[type="checkbox"] {
        width: 16px;
        height: 16px;
      }

      .remember label {
        font-size: 13px;
      }

      .forgot-row {
        margin-top: 0;
        text-align: right;
      }

      .forgot-row a {
        display: block;
        text-align: right;
        margin-top: 8px;
        font-size: 13px;
        padding: 6px 0;
      }

      .card__footer {
        margin-top: 12px;
        padding-top: 10px;
        font-size: 11px;
      }

      .password-toggle-wrap {
        width: 36px;
        height: 36px;
        right: 8px;
      }
    }

    /* Mobile Small — max-width: 479px */
    @media (max-width: 479px) {
      :root {
        --topbar-height: calc(70px + env(safe-area-inset-top, 0px));
      }

      .card {
        width: calc(100% - 24px);
        max-width: none;
        margin-left: 12px;
        margin-right: 12px;
        padding: 18px 16px;
      }

      .card__heading {
        font-size: 18px;
      }

      .card__subheading {
        font-size: 12px;
      }

      .input-wrap input[type="email"],
      .input-wrap input[type="password"],
      .input-wrap input[type="text"] {
        font-size: 16px;
      }

      .input-wrap input[type="password"],
      .input-wrap input[type="text"]#password {
        padding-right: 50px;
      }

      .topbar {
        padding: max(6px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 8px
          max(10px, env(safe-area-inset-left, 0px));
        gap: 1px;
      }

      .topbar__brand {
        font-size: 13px;
        gap: 6px;
      }

      .topbar__brand img {
        width: 18px;
        height: 18px;
      }

      .topbar__meta {
        font-size: 11px;
        padding-left: 24px;
      }

      .card__footer {
        margin-top: 10px;
        padding-top: 8px;
      }
    }

    /* Desktop — show split layout only; top bar hidden (branding lives in left panel + card) */
    @media (min-width: 1024px) {
      .topbar {
        display: none;
      }

      .split {
        padding-top: 0;
      }
    }
