﻿:root {
      --bg-1: #07152c;
      --bg-2: #0b2143;
      --bg-3: #123267;
      --card: rgba(255, 255, 255, 0.14);
      --card-border: rgba(184, 213, 255, 0.28);
      --text: #f3f8ff;
      --muted: #c0d6f7;
      --primary: #2d74e8;
      --primary-2: #51a4ff;
      --accent: #39d7c2;
      --danger: #ff7676;
      --success: #46d486;
      --warning: #ffc35a;
      --shadow: 0 22px 56px rgba(0, 0, 0, 0.35);
      --radius: 24px;
      --input-bg: rgba(255, 255, 255, 0.08);
      --input-border: rgba(198, 220, 255, 0.24);
    }

    * { box-sizing: border-box; }

    html, body {
      margin: 0;
      padding: 0;
      min-height: 100%;
      font-family: "Kanit", "Noto Sans Thai", "Segoe UI", sans-serif;
      color: var(--text);
      background:
        radial-gradient(circle at 12% 18%, rgba(81, 164, 255, 0.34), transparent 34%),
        radial-gradient(circle at 86% 82%, rgba(57, 215, 194, 0.2), transparent 28%),
        linear-gradient(140deg, var(--bg-1), var(--bg-2) 46%, var(--bg-3));
    }

    body {
      display: grid;
      place-items: center;
      padding: 20px;
      overflow-x: hidden;
    }

    .background-blur {
      position: fixed;
      inset: 0;
      pointer-events: none;
      overflow: hidden;
      z-index: 0;
    }

    .blob {
      position: absolute;
      border-radius: 50%;
      filter: blur(80px);
      opacity: 0.45;
      animation: float 12s ease-in-out infinite;
    }

    .blob.one { width: 260px; height: 260px; background: #2f7cf7; top: 6%; left: 8%; }
    .blob.two { width: 320px; height: 320px; background: #31cbb7; bottom: 6%; right: 10%; animation-delay: 2s; }
    .blob.three { width: 190px; height: 190px; background: #79b6ff; top: 50%; left: 52%; animation-delay: 4s; }

    @keyframes float {
      0%, 100% { transform: translateY(0) translateX(0) scale(1); }
      50% { transform: translateY(-18px) translateX(14px) scale(1.05); }
    }

    .register-container {
      width: 100%;
      max-width: 1080px;
      display: grid;
      grid-template-columns: 1.04fr 0.96fr;
      gap: 22px;
      align-items: stretch;
      position: relative;
      z-index: 1;
    }

    .brand-panel,
    .form-panel {
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      background: var(--card);
      border: 1px solid var(--card-border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
    }

    .brand-panel {
      padding: 34px;
      min-height: 640px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      overflow: hidden;
    }

    .brand-top { display: grid; gap: 22px; }

    .brand-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
    }

    .brand-tools {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .brand-logo {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      text-decoration: none;
      color: #ecf5ff;
      font-weight: 700;
    }

    .brand-logo img {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      object-fit: cover;
      box-shadow: 0 10px 18px rgba(32, 101, 214, 0.36);
    }

    .back-link {
      color: var(--muted);
      text-decoration: none;
      font-size: 0.92rem;
      padding: 8px 12px;
      border-radius: 999px;
      border: 1px solid rgba(187, 214, 248, 0.28);
      background: rgba(255, 255, 255, 0.05);
    }

    .back-link:hover { color: #fff; }

    .language-switcher {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px;
      border-radius: 999px;
      border: 1px solid rgba(187, 214, 248, 0.28);
      background: rgba(255, 255, 255, 0.05);
    }

    .lang-btn {
      border: 0;
      min-width: 40px;
      height: 32px;
      border-radius: 999px;
      background: transparent;
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 700;
      cursor: pointer;
      transition: 0.18s ease;
    }

    .lang-btn:hover {
      color: #fff;
    }

    .lang-btn.active {
      color: #fff;
      background: linear-gradient(135deg, var(--primary), var(--primary-2));
      box-shadow: 0 10px 20px rgba(53, 130, 235, 0.28);
    }

    .brand-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      width: fit-content;
      padding: 10px 14px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(200, 222, 255, 0.22);
      color: var(--muted);
      font-size: 0.86rem;
      font-weight: 500;
    }

    .brand-badge .dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), var(--primary-2));
      box-shadow: 0 0 18px rgba(74, 186, 255, 0.75);
    }

    .hero h1 {
      margin: 0 0 12px;
      font-size: clamp(2rem, 4vw, 3.25rem);
      line-height: 1.08;
      letter-spacing: -0.02em;
    }

    .hero p {
      margin: 0;
      color: var(--muted);
      line-height: 1.72;
      max-width: 530px;
      font-size: 0.98rem;
    }

    .feature-grid {
      margin-top: 20px;
      display: grid;
      gap: 12px;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-card {
      padding: 15px;
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(201, 223, 255, 0.18);
    }

    .feature-card strong {
      display: block;
      margin-bottom: 7px;
      font-size: 0.95rem;
    }

    .feature-card span {
      color: var(--muted);
      font-size: 0.84rem;
      line-height: 1.52;
    }

    .plan-intent {
      margin-top: 18px;
      padding: 14px;
      border-radius: 14px;
      border: 1px solid rgba(86, 210, 190, 0.34);
      background: rgba(57, 215, 194, 0.12);
      color: #dbfff8;
      font-size: 0.9rem;
      line-height: 1.6;
    }

    .plan-intent strong { display: block; margin-bottom: 4px; }

    .brand-footer {
      color: rgba(241, 248, 255, 0.78);
      font-size: 0.84rem;
    }

    .form-panel {
      padding: 30px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .form-header {
      margin-bottom: 16px;
    }

    .form-header h2 {
      margin: 0 0 7px;
      font-size: 1.95rem;
      letter-spacing: -0.02em;
    }

    .form-header p {
      margin: 0;
      color: var(--muted);
      font-size: 0.94rem;
    }

    form { display: grid; gap: 14px; }

    .field { display: flex; flex-direction: column; gap: 7px; position: relative; }

    .field label {
      font-size: 0.92rem;
      font-weight: 500;
      color: #eef5ff;
    }

    .input-wrap { position: relative; }

    .field input {
      width: 100%;
      padding: 13px 14px;
      padding-right: 50px;
      border-radius: 14px;
      border: 1px solid var(--input-border);
      background: var(--input-bg);
      color: var(--text);
      outline: none;
      font-size: 0.95rem;
      transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }

    .field input::placeholder { color: rgba(243, 248, 255, 0.48); }

    .field input:focus {
      border-color: rgba(80, 170, 255, 0.92);
      box-shadow: 0 0 0 4px rgba(80, 170, 255, 0.18);
    }

    .toggle-password {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      border: 0;
      background: rgba(255, 255, 255, 0.08);
      color: #d8e8ff;
      cursor: pointer;
      font-size: 0.78rem;
      font-weight: 600;
      padding: 5px 9px;
      border-radius: 10px;
    }

    .toggle-password:hover { color: #fff; }

    .password-meter {
      display: flex;
      gap: 6px;
      margin-top: 1px;
    }

    .password-meter span {
      height: 8px;
      flex: 1;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.13);
      transition: background 0.2s ease, transform 0.2s ease;
    }

    .password-hint {
      font-size: 0.78rem;
      color: var(--muted);
      min-height: 17px;
      margin-top: 2px;
    }

    .checkbox-row {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      color: var(--muted);
      font-size: 0.84rem;
      line-height: 1.55;
    }

    .checkbox-row input {
      margin-top: 2px;
      width: 16px;
      height: 16px;
      accent-color: #56a8ff;
      flex-shrink: 0;
    }

    .checkbox-row a {
      color: #dff0ff;
      text-decoration: none;
    }

    .checkbox-row a:hover { text-decoration: underline; }

    .submit-btn {
      border: 0;
      border-radius: 16px;
      padding: 13px 16px;
      font-size: 0.96rem;
      font-weight: 700;
      color: #fff;
      cursor: pointer;
      background: linear-gradient(135deg, var(--primary), var(--primary-2));
      box-shadow: 0 15px 28px rgba(53, 130, 235, 0.35);
      transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
    }

    .submit-btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 18px 30px rgba(53, 130, 235, 0.45);
    }

    .submit-btn:disabled {
      opacity: 0.75;
      cursor: not-allowed;
      transform: none;
    }

    .login-link {
      text-align: center;
      color: var(--muted);
      font-size: 0.86rem;
      margin-top: 2px;
    }

    .login-link a {
      color: #ecf6ff;
      font-weight: 700;
      text-decoration: none;
    }

    .login-link a:hover { text-decoration: underline; }

    .message {
      min-height: 20px;
      font-size: 0.84rem;
      font-weight: 600;
      padding-top: 2px;
    }

    .message.error { color: #ffd0d0; }
    .message.success { color: #cbffe0; }

    .error-text {
      color: #ffd0d0;
      font-size: 0.75rem;
      min-height: 14px;
      padding-left: 2px;
    }

    .field.error input {
      border-color: rgba(255, 118, 118, 0.88);
      box-shadow: 0 0 0 4px rgba(255, 118, 118, 0.12);
    }

    .field.success input {
      border-color: rgba(70, 212, 134, 0.88);
    }

    .lang-btn:focus-visible,
    .toggle-password:focus-visible,
    .submit-btn:focus-visible,
    .back-link:focus-visible,
    .login-link a:focus-visible,
    .checkbox-row a:focus-visible {
      outline: 2px solid rgba(176, 220, 255, 0.92);
      outline-offset: 2px;
      box-shadow: 0 0 0 4px rgba(80, 170, 255, 0.18);
    }

    .loading-spinner {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      border: 2px solid rgba(255, 255, 255, 0.45);
      border-top-color: #fff;
      display: inline-block;
      margin-right: 8px;
      vertical-align: middle;
      animation: spin 0.7s linear infinite;
    }

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

    @media (max-width: 960px) {
      .register-container { grid-template-columns: 1fr; }
      .brand-panel { min-height: auto; }
    }

    @media (max-width: 640px) {
      body { padding: 14px; }
      .brand-panel, .form-panel { padding: 22px; border-radius: 20px; }
      .feature-grid { grid-template-columns: 1fr; }
      .hero h1 { font-size: 2.1rem; }
      .form-header h2 { font-size: 1.7rem; }
      .brand-row { flex-wrap: wrap; }
      .brand-tools { width: 100%; justify-content: space-between; }
    }

    /* Register aligned with Index V2 surfaces */
    html[data-index-v2-theme],
    html[data-index-v2-theme] body,
    body {
      --primary: var(--accent, var(--sgv2-accent, #2587e8));
      --primary-2: var(--accent-2, var(--sgv2-accent-2, #ee6a5f));
      --accent: var(--sgv2-accent-3, #1fa98d);
      --card: var(--index-v2-panel-bg, linear-gradient(165deg, color-mix(in srgb, var(--primary) 22%, rgba(14, 30, 50, 0.76)), color-mix(in srgb, var(--accent) 12%, rgba(16, 36, 58, 0.64)) 48%, color-mix(in srgb, var(--primary-2) 15%, rgba(14, 28, 47, 0.7))));
      --card-border: color-mix(in srgb, var(--primary) 24%, rgba(184, 213, 255, 0.16));
      --text: #f3f8ff;
      --muted: #aec6e9;
      --shadow: 0 22px 56px rgba(0, 0, 0, 0.24);
      --radius: 8px;
      --input-bg: color-mix(in srgb, var(--primary) 12%, rgba(255, 255, 255, 0.08));
      --input-border: color-mix(in srgb, var(--primary) 24%, rgba(162, 205, 255, 0.18));
      background:
        radial-gradient(circle at 12% 18%, var(--index-v2-glow-a, color-mix(in srgb, var(--primary) 42%, transparent)), transparent 34%),
        radial-gradient(circle at 86% 82%, var(--index-v2-glow-b, color-mix(in srgb, var(--primary-2) 28%, transparent)), transparent 28%),
        linear-gradient(140deg, var(--bg-primary, #07152c) 0%, var(--bg-secondary, #0b2143) 46%, var(--bg-tertiary, #123267) 100%);
    }

    body {
      padding: calc(var(--sheetgenie-topbar-offset, 82px) + 20px) 20px 28px;
    }

    .blob.one {
      background: var(--primary);
    }

    .blob.two {
      background: var(--accent);
    }

    .blob.three {
      background: color-mix(in srgb, var(--primary) 62%, #ffffff);
    }

    .brand-panel,
    .form-panel,
    .feature-card,
    .plan-intent {
      border-color: var(--card-border);
      border-radius: var(--radius);
      background: var(--card);
      box-shadow: var(--shadow);
    }

    .back-link,
    .language-switcher,
    .brand-badge,
    .input-wrap,
    input,
    .checkbox-row,
    .toggle-password {
      border-color: var(--input-border);
      background: var(--input-bg);
      color: var(--text);
    }

    .lang-btn.active,
    .submit-btn {
      background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 64%, var(--primary-2)));
      box-shadow: 0 14px 28px color-mix(in srgb, var(--primary) 24%, rgba(4, 12, 24, 0.32));
    }

    @media (max-width: 640px) {
      body {
        padding: calc(var(--sheetgenie-topbar-offset, 74px) + 14px) 14px 24px;
      }
    }
