/* tg-design.css — shared design tokens and components (spec B13).
   Brand colours and the logo are fixed: Toxic Violet #44107A, Soft Chrome #D8DCE2 and the gold
   accent come from the existing --tg-* tokens; this file only adds type, shape and spacing. */

:root {
  --tg-font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --tg-radius-sm: 8px;
  --tg-radius-md: 12px;
  --tg-radius-lg: 16px;
  --tg-shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --tg-shadow-2: 0 12px 32px rgba(15, 23, 42, 0.16);
  --tg-focus: 0 0 0 3px rgba(196, 168, 232, 0.55);
  --tg-control-h: 46px;
}

body {
  font-family: var(--tg-font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font-family: inherit; }

.tg-ic { display: inline-block; flex-shrink: 0; vertical-align: -0.2em; }

/* ------------------------------------------------------------ Sign-in / create account */
.tgsi-backdrop { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 7, 18, 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow-y: auto; }
.tgsi-card { position: relative; width: 100%; max-width: 440px; margin: auto; padding: 28px; border-radius: var(--tg-radius-lg); background: #08101f; border: 1px solid #1e293b; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); color: #e2e8f0; font-family: var(--tg-font-ui); }
.tgsi-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.tgsi-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #c4a8e8; }
.tgsi-title { margin: 4px 0 0; font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; color: #f8fafc; }
.tgsi-close { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid #1e293b; background: transparent; color: #94a3b8; cursor: pointer; }
.tgsi-close:hover { color: #f8fafc; background: #111a2e; }
.tgsi-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 20px; border-radius: var(--tg-radius-md); background: #030712; border: 1px solid #1e293b; }
.tgsi-tab { flex: 1; min-height: 40px; border: 0; border-radius: var(--tg-radius-sm); background: transparent; color: #94a3b8; font-size: 15px; font-weight: 600; cursor: pointer; }
.tgsi-tab[aria-selected="true"] { background: var(--tg-primary, #44107A); color: #fff; }
.tgsi-tab:not([aria-selected="true"]):hover { color: #e2e8f0; }
.tgsi-alert { display: none; padding: 10px 14px; margin-bottom: 14px; border-radius: var(--tg-radius-sm); font-size: 14px; line-height: 1.45; }
.tgsi-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; border-radius: var(--tg-radius-md); border: 1px solid #dadce0; background: #ffffff; color: #1f2937; font-size: 16px; font-weight: 600; cursor: pointer; }
.tgsi-google:hover { background: #f8fafc; }
.tgsi-legal { margin: 10px 0 18px; text-align: center; font-size: 13px; line-height: 1.5; color: #94a3b8; }
.tgsi-legal a, .tgsi-consent a { color: #c4a8e8; }
.tgsi-or { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; }
.tgsi-or::before, .tgsi-or::after { content: ''; flex: 1; height: 1px; background: #1e293b; }
.tgsi-field { margin-bottom: 14px; }
.tgsi-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: #cbd5e1; }
.tgsi-input { display: block; width: 100%; min-height: var(--tg-control-h); padding: 10px 14px; border-radius: var(--tg-radius-sm); border: 1px solid #263248; background: #030712; color: #f8fafc; font-size: 16px; /* 16 px stops iPhones zooming in on tap */ box-sizing: border-box; outline: none; }
.tgsi-input::placeholder { color: #64748b; }
.tgsi-input:focus { border-color: #c4a8e8; box-shadow: var(--tg-focus); }
.tgsi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tgsi-check { display: flex; align-items: center; gap: 10px; margin: 2px 0 18px; font-size: 14px; color: #cbd5e1; cursor: pointer; }
.tgsi-check input, .tgsi-consent input { width: 18px; height: 18px; accent-color: var(--tg-primary, #44107A); flex-shrink: 0; }
.tgsi-consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: 14px; line-height: 1.5; color: #cbd5e1; cursor: pointer; }
.tgsi-consent input { margin-top: 2px; }
.tgsi-primary { display: block; width: 100%; min-height: 48px; border: 0; border-radius: var(--tg-radius-md); background: var(--tg-primary, #44107A); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; transition: background 0.15s, opacity 0.15s; }
.tgsi-primary:hover { background: var(--tg-primary-hover, #5a1a9e); }
.tgsi-primary:disabled { opacity: 0.7; cursor: progress; }
.tgsi-tab:focus-visible, .tgsi-google:focus-visible, .tgsi-primary:focus-visible, .tgsi-close:focus-visible { outline: none; box-shadow: var(--tg-focus); }
@media (max-width: 480px) {
  .tgsi-card { padding: 22px 18px; }
  .tgsi-title { font-size: 22px; }
  .tgsi-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ Dashboard */
.tg-dash-pill { display: inline-flex; align-items: center; gap: 6px; }
.tg-dash-tab { display: inline-flex; align-items: center; gap: 8px; }
.tg-qa-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--tg-radius-sm); background: rgba(68, 16, 122, 0.08); color: #44107A; flex-shrink: 0; }

/* Small phones: the top bar must fit 360–400 px without sideways scrolling */
@media (max-width: 480px) {
  header { padding: 0 12px !important; }
  .tg-top-left { gap: 8px !important; }
  .tg-credit-pill { padding: 4px 8px !important; }
  #tg-top-nav-btns [data-top] { padding: 3px 4px !important; }
  #topbar-language-select, .tripgenie-lang-selector { display: none !important; }
}

/* ------------------------------------------------------------ Polished screens (.tg-ui)
   Added to a screen's root once it has been through the design pass (Community, Document
   Toolbox); other screens are unchanged until their turn. */
.tg-ui { font-family: var(--tg-font-ui); }
.tg-ui .tg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; border-radius: var(--tg-radius-sm); }
.tg-ui .btn-primary { background: var(--tg-primary, #44107A); color: #fff; }
.tg-ui .btn-primary:hover { background: var(--tg-primary-hover, #5a1a9e); }
.tg-ui .btn-outline { background: #fff; color: #334155; border: 1px solid #cbd5e1; }
.tg-ui .btn-outline:hover { background: #f8fafc; color: #0f172a; border-color: #94a3b8; }
.tg-ui button:focus-visible, .tg-ui a:focus-visible, .tg-ui [role="tab"]:focus-visible { outline: none; box-shadow: var(--tg-focus); }
.tg-ui input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus, .tg-ui textarea:focus, .tg-ui select:focus { outline: none; border-color: #c4a8e8 !important; box-shadow: var(--tg-focus); }
.tg-ui button .tg-ic { vertical-align: -0.2em; }
/* Phones: 16 px form text so iPhones don't zoom in when a field is tapped */
@media (max-width: 480px) {
  .tg-ui input:not([type="checkbox"]):not([type="radio"]), .tg-ui textarea, .tg-ui select { font-size: 16px !important; }
}
