/* ==========================================================================
   CmdVault - Google Material 3 / Modern Google Aesthetic
   Typography: Google Sans Flex & Google Sans Code
   ========================================================================== */

/* Local Font Declarations */
@font-face {
  font-family: 'Google Sans Flex';
  src: url('../font-familiy/Google_Sans_Flex/GoogleSansFlex-VariableFont_GRAD,ROND,opsz,slnt,wdth,wght.ttf') format('truetype-variations'),
       url('../font-familiy/Google_Sans_Flex/static/GoogleSansFlex_36pt-Regular.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Google Sans Code';
  src: url('../font-familiy/Google_Sans_Code/static/GoogleSansCode-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Google Sans Code';
  src: url('../font-familiy/Google_Sans_Code/static/GoogleSansCode-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Google Sans Code';
  src: url('../font-familiy/Google_Sans_Code/static/GoogleSansCode-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Google Sans Code';
  src: url('../font-familiy/Google_Sans_Code/static/GoogleSansCode-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   Google Design Tokens (Material 3 Dark by Default)
   ========================================================================== */
:root {
  /* Google Dark Theme Palette (Gemini & Google Cloud Dark) */
  --g-bg: #131314;
  --g-surface: #1e1f20;
  --g-surface-elevated: #282a2c;
  --g-surface-hover: #333537;
  --g-surface-active: #3c4043;
  --g-border: rgba(255, 255, 255, 0.12);
  --g-border-subtle: rgba(255, 255, 255, 0.07);
  --g-border-focus: #8ab4f8;

  /* Google Colors */
  --google-blue: #8ab4f8;
  --google-blue-surface: rgba(138, 180, 248, 0.16);
  --google-blue-hover: #aecbfa;
  --google-red: #f28b82;
  --google-yellow: #fdd663;
  --google-green: #81c995;
  --google-green-surface: rgba(129, 201, 149, 0.16);

  /* Typography Text Colors */
  --text-primary: #e3e3e3;
  --text-secondary: #c4c7c5;
  --text-tertiary: #8e918f;
  --text-disabled: #5e6260;

  /* Elevation Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 4px 8px 3px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 2px 6px 2px rgba(0, 0, 0, 0.3), 0 8px 24px 6px rgba(0, 0, 0, 0.2);

  /* Fonts */
  --font-display: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-code: 'Google Sans Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Google Light Theme Palette */
body.light-theme {
  --g-bg: #f8fafd;
  --g-surface: #ffffff;
  --g-surface-elevated: #edf2fa;
  --g-surface-hover: #e3e9f3;
  --g-surface-active: #d7e0ee;
  --g-border: rgba(0, 0, 0, 0.12);
  --g-border-subtle: rgba(0, 0, 0, 0.06);
  --g-border-focus: #1a73e8;

  --google-blue: #1a73e8;
  --google-blue-surface: rgba(26, 115, 232, 0.1);
  --google-blue-hover: #1557b0;
  --google-red: #d93025;
  --google-yellow: #f9ab00;
  --google-green: #188038;
  --google-green-surface: rgba(24, 128, 56, 0.1);

  --text-primary: #1f1f1f;
  --text-secondary: #444746;
  --text-tertiary: #747775;
  --text-disabled: #a8aaa7;

  --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --shadow-md: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
  --shadow-lg: 0 2px 6px 2px rgba(60, 64, 67, 0.3), 0 8px 24px 6px rgba(60, 64, 67, 0.2);
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--g-bg);
  color: var(--text-primary);
  font-family: var(--font-display);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ==========================================================================
   Header Bar (Google Brand & Pill Search)
   ========================================================================== */
.header-bar {
  width: 100%;
  background-color: var(--g-bg);
  border-bottom: 1px solid var(--g-border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.25s ease;
}

.header-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

/* Brand Logo (Clean, Sharp & Exact to Figma) */
.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.logo-wrapper:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.logo-symbol {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  color: #fff9f9;
  line-height: 1;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

body.light-theme .logo-symbol {
  color: #1a73e8;
  text-shadow: none;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1;
}

/* Google Search Pill */
.search-container {
  flex: 1;
  max-width: 680px;
  height: 52px;
  background-color: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 28px;
  display: flex;
  align-items: center;
  padding: 0 20px 0 24px;
  gap: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.search-container:hover {
  background-color: var(--g-surface-hover);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-md);
}

body.light-theme .search-container:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.search-container:focus-within {
  background-color: var(--g-surface);
  border-color: var(--g-border-focus);
  box-shadow: 0 0 0 3px var(--google-blue-surface), var(--shadow-md);
}

.search-icon {
  width: 20px;
  height: 20px;
  opacity: 0.65;
  flex-shrink: 0;
  pointer-events: none;
  filter: brightness(0) invert(0.85);
  transition: opacity 0.2s ease;
}

.search-container:hover .search-icon,
.search-container:focus-within .search-icon {
  opacity: 0.95;
}

body.light-theme .search-icon {
  filter: brightness(0);
  opacity: 0.55;
}

body.light-theme .search-container:hover .search-icon,
body.light-theme .search-container:focus-within .search-icon {
  opacity: 0.9;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
}

.search-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 300;
}

/* Keyboard Shortcut Badge */
.search-kbd {
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--g-surface-elevated);
  border: 1px solid var(--g-border);
  border-radius: 6px;
  padding: 3px 7px;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.search-container:focus-within .search-kbd {
  opacity: 0;
  pointer-events: none;
}

.search-clear {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 18px;
  cursor: pointer;
  display: none;
  padding: 4px;
  border-radius: 50%;
  transition: color 0.15s ease;
}

.search-clear:hover {
  color: var(--text-primary);
}

.search-clear.visible {
  display: block;
}

/* Right Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Google Material 3 Tonal Button */
.auth-btn {
  height: 48px;
  padding: 0 24px;
  background-color: var(--g-surface-elevated);
  border: 1px solid var(--g-border);
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-btn:hover {
  background-color: var(--g-surface-hover);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

body.light-theme .auth-btn:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.auth-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Logged In Profile */
.user-profile {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--g-surface-elevated);
  padding: 4px 16px 4px 6px;
  border-radius: 24px;
  border: 1px solid var(--g-border);
}

.user-profile.active {
  display: flex;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--google-blue);
  object-fit: cover;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--google-red);
  cursor: pointer;
  text-decoration: none;
}

.logout-link:hover {
  text-decoration: underline;
}

/* Material 3 Icon Button (Theme Toggle) */
.theme-btn {
  height: 48px;
  width: 48px;
  background-color: var(--g-surface-elevated);
  border: 1px solid var(--g-border);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-btn:hover {
  background-color: var(--g-surface-hover);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

body.light-theme .theme-btn:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.theme-btn:active {
  transform: scale(0.95);
}

.theme-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(1.2);
}

body.light-theme .theme-icon {
  filter: invert(1);
  transform: rotate(180deg);
}

/* ==========================================================================
   Category Navigation Bar (Google Material 3 Segmented Nav)
   ========================================================================== */
.category-nav-bar {
  background-color: var(--g-surface);
  width: 100%;
  border-top: 1px solid var(--g-border-subtle);
  border-bottom: 1px solid var(--g-border-subtle);
}

.category-nav-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 56px;
  gap: 12px;
  overflow-x: auto;
}

.nav-tab {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.nav-tab:hover {
  background-color: var(--g-surface-hover);
  color: var(--text-primary);
}

.nav-tab.active {
  background-color: var(--google-blue-surface);
  color: var(--google-blue);
  border-color: rgba(138, 180, 248, 0.3);
  font-weight: 600;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 56px 80px 56px;
  display: flex;
  flex-direction: column;
}

.section-title-wrap {
  margin-bottom: 40px;
}

.page-title {
  font-size: 40px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}

/* Google Material 3 Filter Chips */
.os-filters-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.os-pill {
  height: 40px;
  padding: 0 20px;
  background-color: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.os-pill:hover {
  background-color: var(--g-surface-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

body.light-theme .os-pill:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.os-pill.active {
  background-color: var(--google-blue-surface);
  border-color: var(--google-blue);
  box-shadow: 0 0 12px rgba(138, 180, 248, 0.2);
}

.os-pill img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.85;
  transition: all 0.2s ease;
}

.os-pill:hover img {
  opacity: 1;
}

body.light-theme .os-pill img {
  filter: brightness(0) opacity(0.75);
}

body.light-theme .os-pill:hover img {
  filter: brightness(0) opacity(0.95);
}

body.light-theme .os-pill.active img {
  filter: brightness(0) opacity(1);
}

.os-pill span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.os-pill.active span {
  color: var(--google-blue);
  font-weight: 600;
}

/* ==========================================================================
   Command Sections & Cards (Google Cloud Shell / DevTools Aesthetic)
   ========================================================================== */
.commands-container {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin-top: 24px;
}

.command-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

.section-heading {
  font-size: 26px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: var(--google-blue);
  border-radius: 2px;
}

.section-desc {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: -12px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.command-group {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.command-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1040px;
}

/* Command Code Box */
.command-box {
  width: 100%;
  min-height: 60px;
  background-color: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.command-box:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background-color: var(--g-surface-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

body.light-theme .command-box:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.command-code-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  overflow: hidden;
}

.command-prompt {
  font-family: var(--font-code);
  font-size: 16px;
  font-weight: 500;
  color: var(--google-green);
  user-select: none;
  flex-shrink: 0;
}

.command-code {
  font-family: var(--font-code);
  font-size: 17px;
  font-weight: 400;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
  letter-spacing: -0.01em;
}

/* Copy Action Button (Google Material Ripple) */
.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 16px;
  flex-shrink: 0;
}

.copy-btn:hover {
  background-color: var(--g-surface-active);
}

.copy-btn:active {
  transform: scale(0.92);
}

.copy-btn img,
.copy-btn svg {
  width: 20px;
  height: 20px;
  opacity: 0.75;
  filter: brightness(0) invert(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.copy-btn:hover img,
.copy-btn:hover svg {
  opacity: 1;
  filter: brightness(0) invert(1);
}

body.light-theme .copy-btn img,
body.light-theme .copy-btn svg {
  opacity: 0.65;
  filter: brightness(0);
}

body.light-theme .copy-btn:hover img,
body.light-theme .copy-btn:hover svg {
  opacity: 0.95;
  filter: brightness(0);
}

.copy-btn.copied {
  background-color: var(--google-green-surface);
}

.copy-btn.copied img,
.copy-btn.copied svg {
  filter: none;
  opacity: 1;
}

.copy-btn.copied svg path {
  fill: var(--google-green);
}

/* Command Explanation */
.command-explanation {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.45;
  padding-left: 6px;
}

/* Section Divider */
.section-divider {
  width: 100%;
  max-width: 1040px;
  margin-top: 32px;
  border: none;
  border-top: 1px solid var(--g-border-subtle);
}

/* Empty State */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 16px;
}

.empty-state.visible {
  display: flex;
}

.empty-state-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
}

.empty-state-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.reset-search-btn {
  margin-top: 14px;
  padding: 10px 24px;
  background-color: var(--google-blue);
  color: #131314;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.reset-search-btn:hover {
  background-color: var(--google-blue-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer-bar {
  width: 100%;
  margin-top: auto;
  border-top: 1px solid var(--g-border-subtle);
  background-color: var(--g-bg);
  padding: 48px 20px 40px 20px;
}

.footer-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.footer-links {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
  line-height: 1.6;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--google-blue);
}

.footer-copyright {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-disabled);
}

/* ==========================================================================
   Google Material 3 Snackbar (Toast Notification)
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background-color: var(--g-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--g-border);
  border-radius: 28px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-icon {
  color: var(--google-green);
  display: flex;
  align-items: center;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .header-inner {
    padding: 16px 28px;
    flex-wrap: wrap;
  }
  .search-container {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .category-nav-inner {
    padding: 0 28px;
  }
  .main-content {
    padding: 36px 28px 60px 28px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 14px 20px;
    gap: 16px;
  }
  .auth-btn {
    padding: 0 14px;
  }
  .auth-label {
    display: none;
  }
  .category-nav-inner {
    padding: 0 16px;
    gap: 8px;
  }
  .main-content {
    padding: 28px 18px 48px 18px;
  }
  .page-title {
    font-size: 30px;
  }
  .section-heading {
    font-size: 22px;
  }
  .section-desc {
    font-size: 15px;
  }
  .command-code {
    font-size: 15px;
  }
  .command-explanation {
    font-size: 14px;
  }
  .command-box {
    padding: 12px 16px;
  }
  .search-kbd {
    display: none;
  }
}

/* ==========================================================================
   Legal Documents & Consent Subtext (Google Material 3)
   ========================================================================== */
.auth-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.auth-legal-subtext {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
  max-width: 250px;
  text-align: right;
  line-height: 1.3;
}

.auth-legal-subtext a {
  color: var(--google-blue);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.auth-legal-subtext a:hover {
  text-decoration: underline;
}

/* Standalone Legal Page Layout */
.legal-page {
  background-color: var(--g-bg);
  color: var(--text-primary);
  min-height: 100vh;
}

.legal-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 80px 24px;
  display: flex;
  flex-direction: column;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--g-border-subtle);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--google-blue);
  text-decoration: none;
  padding: 8px 16px;
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 20px;
  transition: all 0.2s ease;
}

.back-link:hover {
  background: var(--g-surface-hover);
  transform: translateX(-2px);
}

.legal-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 12px;
  background: var(--g-surface-elevated);
  color: var(--text-tertiary);
  border: 1px solid var(--g-border-subtle);
}

.legal-content h1 {
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.effective-date {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 28px;
}

.callout-box {
  background: var(--g-surface);
  border-left: 4px solid var(--google-blue);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin-bottom: 32px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.warning-box {
  background: rgba(242, 139, 130, 0.12);
  border-left: 4px solid var(--google-red);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 16px 0 20px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--google-red);
}

.legal-content section {
  margin-bottom: 36px;
}

.legal-content h2 {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.legal-content p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.legal-content ul {
  margin: 12px 0 16px 24px;
}

.legal-content li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.legal-content a {
  color: var(--google-blue);
  text-decoration: underline;
}

.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 12px;
  border: 1px solid var(--g-border);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.legal-table th {
  background: var(--g-surface-elevated);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--g-border);
}

.legal-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--g-border-subtle);
}

.legal-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--g-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.legal-footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-footer-links a {
  color: inherit;
  text-decoration: none;
}

.legal-footer-links a:hover {
  color: var(--google-blue);
}

/* In-App Interactive Legal Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  width: 100%;
  max-width: 780px;
  max-height: 85vh;
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--g-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--g-surface-hover);
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--g-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--g-surface-elevated);
}

.modal-external-link {
  font-size: 13px;
  color: var(--google-blue);
  text-decoration: none;
}

.modal-external-link:hover {
  text-decoration: underline;
}

.modal-btn {
  padding: 8px 20px;
  background: var(--google-blue);
  color: #131314;
  border: none;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
