:root {
      --bg-pantone-deep: #F8FAFC;
      --bg-pantone-navy: #FFFFFF;
      --bg-pantone-card: #FFFFFF;
      --border-card: #E2E8F0;
      --border-card-hover: rgba(2, 132, 199, 0.45);

      /* Official SangcaTrack Brand Colors (Logo Matched) */
      --brand-sangca: #0E4D88;
      --brand-sangca-glow: rgba(14, 77, 136, 0.14);
      --brand-track: #41B34C;
      --brand-track-glow: rgba(65, 179, 76, 0.14);

      --pantone-yellow: #D97706;
      --pantone-yellow-glow: rgba(217, 119, 6, 0.22);
      --pantone-yellow-light: #B45309;

      --pantone-blue: #0284C7;
      --pantone-blue-glow: rgba(2, 132, 199, 0.22);
      --pantone-blue-dark: #0369A1;

      --text-main: #0F172A;
      --text-muted: #475569;
      --text-subtle: #64748B;
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    }

    html, body {
      min-height: 100vh;
      width: 100%;
      background: #F8FAFC;
      color: var(--text-main);
      overflow-x: hidden;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* 50/50 Full-Bleed Split Screen Layout */
    .portal-wrapper {
      width: 100%;
      min-height: 100vh;
      display: grid;
      grid-template-columns: 1.08fr 1fr;
      background: #FFFFFF;
    }

    /* Left 50%: Pure White Studio Showcase Column */
    .brand-showcase {
      background: #FFFFFF;
      border-right: 1px solid var(--border-card);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 36px 48px;
      position: relative;
    }

    .showcase-banner-box {
      width: 100%;
      max-width: 580px;
      aspect-ratio: 1 / 1;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .showcase-banner-box img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      border-radius: 14px;
    }

    /* Integrated Bottom Google Play & App Store Dock */
    .showcase-dock {
      width: 100%;
      max-width: 580px;
      margin-top: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 14px;
    }

    .dock-play-link {
      display: inline-flex;
      align-items: center;
      flex-shrink: 0;
      transition: transform 0.2s ease;
    }

    .dock-play-link:hover {
      transform: translateY(-2px);
    }

    .dock-play-link img {
      height: 38px;
      border-radius: 6px;
      display: block;
    }

    /* Right 50%: Softly Tinted Auth Column */
    .auth-column {
      background: #F8FAFC;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 40px 32px;
      min-height: 100vh;
    }

    .login-card {
      width: 100%;
      max-width: 435px;
      background: var(--bg-pantone-card);
      border: 1px solid var(--border-card);
      border-radius: 22px;
      padding: 40px 36px;
      box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.08), 0 4px 16px -4px rgba(15, 23, 42, 0.03);
      position: relative;
    }

    .mobile-app-bar {
      display: none;
      margin-top: 20px;
      text-align: center;
    }

    /* Branding Header */
    .brand-header {
      text-align: center;
      margin-bottom: 28px;
    }

    .brand-title {
      font-size: 34px;
      font-weight: 800;
      letter-spacing: -0.5px;
      display: inline-flex;
      align-items: center;
      gap: 2px;
      text-shadow: none;
    }

    /* OFFICIAL BRAND DUAL TONE (Logo-Matched: Navy Blue & Leaf Green) */
    .brand-sangca {
      color: var(--brand-sangca, #0E4D88);
      text-shadow: 0 1px 6px var(--brand-sangca-glow, rgba(14, 77, 136, 0.18));
    }

    .brand-track {
      color: var(--brand-track, #41B34C);
      text-shadow: 0 1px 6px var(--brand-track-glow, rgba(65, 179, 76, 0.18));
    }

    .brand-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: #F0F9FF;
      border: 1px solid #BAE6FD;
      color: var(--pantone-blue);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.8px;
      text-transform: uppercase;
      padding: 4px 10px;
      border-radius: 20px;
      margin-top: 8px;
    }

    .brand-badge svg {
      width: 12px;
      height: 12px;
    }

    .brand-subtitle {
      color: var(--text-muted);
      font-size: 13.5px;
      margin-top: 8px;
      font-weight: 400;
    }

    /* Form Inputs */
    .input-group {
      margin-bottom: 18px;
      position: relative;
    }

    .input-label {
      display: block;
      font-size: 12.5px;
      font-weight: 600;
      color: #334155;
      margin-bottom: 7px;
      letter-spacing: 0.2px;
    }

    .input-wrapper {
      position: relative;
      display: flex;
      align-items: center;
    }

    .input-icon {
      position: absolute;
      left: 14px;
      color: var(--text-subtle);
      width: 18px;
      height: 18px;
      pointer-events: none;
      transition: color 0.2s ease;
    }

    .input-field {
      width: 100%;
      background: #F8FAFC;
      border: 1.5px solid #CBD5E1;
      border-radius: 12px;
      padding: 13px 14px 13px 44px;
      font-size: 14.5px;
      color: var(--text-main);
      outline: none;
      transition: all 0.25s ease;
    }

    .input-field-pw {
      padding-right: 46px;
    }

    .input-field::placeholder {
      color: #94A3B8;
    }

    .input-field:focus {
      background: #FFFFFF;
      border-color: var(--pantone-blue);
      box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.16);
    }

    .input-field:focus + .input-icon,
    .input-wrapper:focus-within .input-icon {
      color: var(--pantone-blue);
    }

    /* Password Toggle Button */
    .toggle-pw-btn {
      position: absolute;
      right: 12px;
      background: transparent;
      border: none;
      color: var(--text-subtle);
      cursor: pointer;
      padding: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      transition: all 0.2s ease;
    }

    .toggle-pw-btn:hover {
      color: var(--pantone-blue);
      background: #F1F5F9;
    }

    .toggle-pw-btn svg {
      width: 18px;
      height: 18px;
      pointer-events: none;
    }

    /* Extras Row */
    .form-extras {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 22px;
      font-size: 13px;
    }

    .remember-me {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #475569;
      cursor: pointer;
      user-select: none;
    }

    .remember-me input {
      accent-color: var(--pantone-blue);
      width: 15px;
      height: 15px;
      cursor: pointer;
    }

    .support-link {
      color: var(--pantone-blue);
      text-decoration: none;
      font-size: 13px;
      font-weight: 600;
      transition: color 0.2s ease;
    }

    .support-link:hover {
      color: var(--pantone-blue-dark);
      text-decoration: underline;
    }

    /* Login Action Button */
    .btn-login {
      width: 100%;
      padding: 14px 20px;
      background: linear-gradient(135deg, #0E4D88 0%, var(--pantone-blue) 100%);
      color: #FFFFFF;
      font-weight: 700;
      font-size: 14.5px;
      border: none;
      border-radius: 12px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      box-shadow: 0 8px 22px rgba(14, 77, 136, 0.28);
      transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      letter-spacing: 0.4px;
      text-transform: uppercase;
    }

    .btn-login:hover {
      background: linear-gradient(135deg, #0369A1 0%, #075985 100%);
      box-shadow: 0 10px 28px rgba(2, 132, 199, 0.45);
      transform: translateY(-2px);
    }

    .btn-login:active {
      transform: translateY(0);
      box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    }

    .btn-login svg {
      width: 18px;
      height: 18px;
      transition: transform 0.2s ease;
    }

    .btn-login:hover svg {
      transform: translateX(3px);
    }

    /* Error Alert */
    #error-msg {
      margin-top: 16px;
      padding: 12px 14px;
      background: #FEF2F2;
      border: 1px solid #FECACA;
      color: #DC2626;
      font-size: 13px;
      font-weight: 500;
      border-radius: 10px;
      text-align: center;
      display: none;
      animation: fadeIn 0.25s ease;
    }

    /* Auth Divider */
    .auth-divider {
      display: flex;
      align-items: center;
      margin: 22px 0 18px;
      gap: 14px;
    }

    .divider-line {
      flex: 1;
      height: 1px;
      background: var(--border-card);
    }

    .divider-text {
      color: var(--text-subtle);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 1px;
      text-transform: uppercase;
    }

    /* Google Auth Container */
    .google-auth-box {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }

    .google-auth-box .g_id_signin {
      width: 100%;
    }

    /* Custom Login with Google Button */
    .btn-google {
      width: 100%;
      padding: 12px 20px;
      background: #ffffff;
      border: 1.5px solid var(--border-card);
      border-radius: 12px;
      color: #1E293B;
      font-size: 14.5px;
      font-weight: 600;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
      transition: all 0.2s ease;
      font-family: inherit;
    }

    .btn-google:hover {
      background: #F8FAFC;
      border-color: #CBD5E1;
      box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
      transform: translateY(-1px);
    }

    .btn-google:active {
      transform: translateY(0);
      box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    }

    .btn-google svg {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(-6px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* Subtle Website Navigation Links */
    .portal-back-links {
      margin-top: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      font-size: 12.5px;
      font-weight: 600;
      color: var(--text-subtle);
    }

    .portal-back-links a {
      color: var(--text-subtle);
      text-decoration: none;
      transition: color 0.15s ease;
    }

    .portal-back-links a:hover {
      color: var(--pantone-blue);
      text-decoration: underline;
    }

    @media (max-width: 920px) {
      .portal-wrapper {
        grid-template-columns: 1fr;
      }
      .brand-showcase {
        display: none; /* Mobile view: focus immediately on the login box */
      }
      .auth-column {
        padding: 28px 18px;
      }
      .login-card {
        padding: 34px 24px;
      }
      .mobile-app-bar {
        display: block;
      }
    }

    .portal-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.6);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      opacity: 0;
      visibility: hidden;
      transition: all 0.25s ease;
    }

    .portal-modal-overlay.active {
      opacity: 1;
      visibility: visible;
    }

    .portal-modal-card {
      width: 100%;
      max-width: 460px;
      background: var(--bg-pantone-card);
      border: 1px solid var(--border-card);
      border-radius: 24px;
      padding: 32px 28px;
      box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.04);
      transform: translateY(16px) scale(0.96);
      transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
      position: relative;
      color: var(--text-main);
    }

    .portal-modal-overlay.active .portal-modal-card {
      transform: translateY(0) scale(1);
    }

    .modal-close-btn {
      position: absolute;
      top: 18px;
      right: 18px;
      background: #F1F5F9;
      border: 1px solid var(--border-card);
      color: var(--text-subtle);
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .modal-close-btn:hover {
      background: #FEE2E2;
      border-color: #FCA5A5;
      color: #EF4444;
    }

    .code-input-field {
      text-align: center;
      font-size: 24px !important;
      font-weight: 700 !important;
      letter-spacing: 8px !important;
      font-family: 'JetBrains Mono', monospace !important;
      text-transform: uppercase !important;
      color: var(--text-main) !important;
      background: #F8FAFC !important;
      border-color: #CBD5E1 !important;
    }

    .steps-indicator {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin-bottom: 22px;
    }
    .step-dot {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: #F1F5F9;
      border: 1px solid #CBD5E1;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 700;
      color: var(--text-subtle);
    }
    .step-dot.active {
      background: #E0F2FE;
      border-color: var(--pantone-blue);
      color: var(--pantone-blue);
    }
    .step-dot.completed {
      background: #DCFCE7;
      border-color: #16A34A;
      color: #16A34A;
    }
    .step-line {
      width: 28px;
      height: 2px;
      background: var(--border-card);
    }
    .step-line.completed {
      background: #16A34A;
    }

    .modal-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: #E0F2FE;
      border: 1px solid #BAE6FD;
      color: var(--pantone-blue);
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      padding: 4px 10px;
      border-radius: 20px;
      margin-bottom: 12px;
    }

    .modal-badge.yellow {
      background: #FEF3C7;
      border-color: #FDE68A;
      color: var(--pantone-yellow);
    }

    .modal-feedback {
      margin-top: 14px;
      padding: 10px 14px;
      border-radius: 10px;
      font-size: 12.5px;
      line-height: 1.45;
      display: none;
      animation: fadeIn 0.25s ease;
    }
    .modal-feedback.error {
      background: #FEF2F2;
      border: 1px solid #FECACA;
      color: #DC2626;
    }
    .modal-feedback.success {
      background: #F0FDF4;
      border: 1px solid #BBF7D0;
      color: #16A34A;
    }
