/* ==========================================================================
   TezzCorp Central Identity & Authentication - Google Material Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
  --google-blue: #0b57d0;
  --google-blue-hover: #0842a0;
  --google-blue-surface: #e8f0fe;
  --google-canvas: #f0f4f9;
  --google-surface: #ffffff;
  --google-border: #747775;
  --google-border-subtle: #dadce0;
  --google-border-light: #e0e2ec;
  --google-text-primary: #1f1f1f;
  --google-text-secondary: #444746;
  --google-error: #b3261e;
  --google-error-bg: #fce8e6;
  --google-success: #137333;
  --google-success-bg: #e6f4ea;
  --google-warning: #b06000;
  --google-warning-bg: #fef7e0;
  --radius-card: 28px;
  --radius-input: 4px;
  --radius-pill: 100px;
  --font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --shadow-card: 0 1px 3px 0 rgba(60, 64, 67, 0.12), 0 4px 8px 3px rgba(60, 64, 67, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--google-canvas);
  color: var(--google-text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Container & Google Card ────────────────────────────────────────────────── */

.auth-wrapper {
  width: 100%;
  max-width: 448px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-card {
  width: 100%;
  background: var(--google-surface);
  border-radius: var(--radius-card);
  padding: 40px;
  border: 1px solid var(--google-border-light);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease;
}

/* ── Google Brand & Header ─────────────────────────────────────────────────── */

.google-header {
  margin-bottom: 28px;
}

.google-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.google-brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 0;
  flex-shrink: 0;
}

.google-brand-logo {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
}

.google-title {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--google-text-primary);
  margin-bottom: 0;
  letter-spacing: -0.2px;
}

.google-subtitle {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--google-text-secondary);
  margin-top: 4px;
}

/* ── Google Outlined Material Input Field ──────────────────────────────────── */

.g-field {
  position: relative;
  margin-bottom: 20px;
  width: 100%;
}

.g-input {
  width: 100%;
  height: 56px;
  padding: 16px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--google-text-primary);
  background: transparent;
  border: 1px solid var(--google-border);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.g-input:focus {
  border: 2px solid var(--google-blue);
  padding: 15px 13px;
}

.g-label {
  position: absolute;
  left: 12px;
  top: 18px;
  font-size: 16px;
  color: var(--google-text-secondary);
  pointer-events: none;
  background: var(--google-surface);
  padding: 0 4px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left top;
}

.g-input:focus ~ .g-label,
.g-input:not(:placeholder-shown) ~ .g-label,
.g-input.has-value ~ .g-label {
  top: -8px;
  left: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--google-blue);
}

.g-input.is-invalid {
  border: 2px solid var(--google-error);
  padding: 15px 13px;
}

.g-input.is-invalid ~ .g-label {
  color: var(--google-error);
}

.g-input.is-valid {
  border-color: var(--google-success);
}

.field-status {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  display: none;
  z-index: 2;
}

.field-error {
  font-size: 12px;
  color: var(--google-error);
  margin-top: -14px;
  margin-bottom: 16px;
  padding-left: 12px;
  display: none;
  line-height: 1.4;
}

/* ── Dynamic Field Leading Icon (Login Mail vs Flag) ───────────────────────── */

.g-field-leading-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.g-input.g-input-with-leading {
  padding-left: 48px;
}

.g-input.g-input-with-leading:focus {
  padding-left: 47px;
}

.g-input.g-input-with-leading ~ .g-label {
  left: 46px;
}

.g-input.g-input-with-leading:focus ~ .g-label,
.g-input.g-input-with-leading:not(:placeholder-shown) ~ .g-label,
.g-input.g-input-with-leading.has-value ~ .g-label {
  left: 10px;
  top: -8px;
  font-size: 12px;
}

/* ── Country Flag & Dedicated Phone Input Component ────────────────────────── */

.g-phone-input-wrap {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 20px;
  width: 100%;
}

.g-phone-input-wrap .g-field {
  margin-bottom: 0;
  flex: 1;
}

.g-country-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 12px;
  background: var(--google-surface);
  border: 1px solid var(--google-border);
  border-radius: var(--radius-input);
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  color: var(--google-text-primary);
  flex-shrink: 0;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.g-country-picker-btn:hover {
  background-color: var(--google-canvas);
  border-color: var(--google-text-primary);
}

.g-country-picker-btn:focus,
.g-country-picker-btn.is-active {
  outline: none;
  border-color: var(--google-blue);
  box-shadow: 0 0 0 1px var(--google-blue);
}

.country-flag-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
}

.country-flag {
  border-radius: 2px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.4);
  vertical-align: middle;
}

.country-dial-code {
  font-weight: 500;
  font-size: 15px;
  color: var(--google-text-primary);
}

.g-chevron {
  color: var(--google-text-secondary);
  transition: transform 0.2s ease;
}

.g-country-picker-btn.is-active .g-chevron {
  transform: rotate(180deg);
}

.g-country-picker-btn.is-neutral-mode,
.g-country-picker-btn.is-email-mode {
  cursor: pointer;
  background: transparent;
  border-color: var(--google-border);
  padding: 0 14px;
}

.g-country-picker-btn.is-neutral-mode .country-dial-code,
.g-country-picker-btn.is-neutral-mode .g-chevron,
.g-country-picker-btn.is-email-mode .country-dial-code,
.g-country-picker-btn.is-email-mode .g-chevron {
  display: none;
}

/* ── Global Country Picker Dropdown ────────────────────────────────────────── */

.g-country-dropdown {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  max-width: 380px;
  max-height: 340px;
  background: var(--google-surface);
  border: 1px solid var(--google-border-subtle);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.15s ease-out;
}

.g-country-dropdown.show {
  display: flex;
}

.g-country-search-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid var(--google-border-light);
  background: var(--google-surface);
  position: sticky;
  top: 0;
  z-index: 2;
}

.g-country-search {
  width: 100%;
  height: 38px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--google-border-subtle);
  border-radius: 4px;
  outline: none;
  font-family: inherit;
  color: var(--google-text-primary);
  background: var(--google-canvas);
}

.g-country-search:focus {
  border-color: var(--google-blue);
  background: var(--google-surface);
  box-shadow: 0 0 0 1px var(--google-blue);
}

.g-country-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 4px 0;
  margin: 0;
  max-height: 280px;
}

.g-country-item {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 14px;
  gap: 12px;
  transition: background-color 0.1s ease;
}

.g-country-item:hover,
.g-country-item.is-selected {
  background-color: var(--google-blue-surface);
}

.g-country-item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--google-text-primary);
}

.g-country-item-dial {
  font-weight: 500;
  color: var(--google-text-secondary);
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Inline Helper Links ───────────────────────────────────────────────────── */

.google-link-wrapper {
  margin-top: -8px;
  margin-bottom: 24px;
}

.google-link {
  color: var(--google-blue);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
  padding: 4px 0;
  display: inline-block;
}

.google-link:hover {
  text-decoration: underline;
}

/* ── Action Buttons & Row ──────────────────────────────────────────────────── */

.google-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  gap: 12px;
}

.google-action-row.single-action {
  justify-content: flex-end;
}

.google-text-btn {
  color: var(--google-blue);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  transition: background-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.google-text-btn:hover {
  background-color: rgba(11, 87, 208, 0.08);
}

.google-btn-primary {
  background-color: var(--google-blue);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  min-width: 88px;
  height: 40px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  text-decoration: none;
}

.google-btn-primary:hover {
  background-color: var(--google-blue-hover);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
}

.google-btn-primary:disabled {
  background-color: #1f1f1f;
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

/* Backward compatibility aliases */
.btn {
  font-family: inherit;
}

/* ── Alert & Notification Banners (Google Material Style) ──────────────────── */

.alert {
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
  line-height: 1.45;
  border: 1px solid transparent;
}

.alert-danger {
  background-color: var(--google-error-bg);
  color: var(--google-error);
  border-color: #f5c2c7;
}

.alert-success {
  background-color: var(--google-success-bg);
  color: var(--google-success);
  border-color: #badbcc;
}

.alert-warning {
  background-color: var(--google-warning-bg);
  color: var(--google-warning);
  border-color: #ffecb5;
}

/* ── Password Strength Bar (Google Material 4-segment style) ──────────────── */

.strength-meter {
  height: 4px;
  background-color: var(--google-border-subtle);
  border-radius: 2px;
  margin-top: -12px;
  margin-bottom: 18px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
}

.strength-bar.weak   { width: 33%; background-color: var(--google-error); }
.strength-bar.medium { width: 66%; background-color: #fbbc04; }
.strength-bar.strong { width: 100%; background-color: var(--google-success); }

/* ── Radio Channels (for OTP recovery channel selection) ───────────────────── */

.channel-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.channel-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  border: 1px solid var(--google-border-subtle);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--google-text-primary);
  transition: all 0.2s ease;
  background: var(--google-surface);
}

.channel-option input[type="radio"] {
  display: none;
}

.channel-option:hover {
  background-color: #f8fafd;
  border-color: var(--google-blue);
}

.channel-option.selected {
  border: 2px solid var(--google-blue);
  background-color: var(--google-blue-surface);
  color: var(--google-blue);
  padding: 13px 11px;
}

/* ── 6-Box OTP Code Inputs ─────────────────────────────────────────────────── */

.otp-input-group {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 24px;
}

.otp-box {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 500;
  color: var(--google-text-primary);
  border: 1px solid var(--google-border);
  border-radius: 8px;
  outline: none;
  background: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.otp-box:focus {
  border: 2px solid var(--google-blue);
  box-shadow: 0 0 0 1px var(--google-blue);
}

/* ── Google Footer ─────────────────────────────────────────────────────────── */

.google-footer {
  width: 100%;
  max-width: 448px;
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--google-text-secondary);
  padding: 0 12px;
}

.google-lang-wrap {
  position: relative;
}

.google-lang-select {
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--google-text-secondary);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  outline: none;
  font-family: inherit;
}

.google-lang-select:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--google-text-primary);
}

.google-footer-links {
  display: flex;
  gap: 16px;
}

.google-footer-link {
  color: var(--google-text-secondary);
  text-decoration: none;
  padding: 6px 4px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.google-footer-link:hover {
  color: var(--google-text-primary);
  text-decoration: underline;
}

/* ── Toast Notifications ───────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #323232;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 4px;
  box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14);
  font-size: 14px;
  animation: slideUp 0.3s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Full Responsiveness: Smartphone, Tablet & Desktop ─────────────────────── */

@media (max-width: 600px) {
  body {
    padding: 0;
    background-color: var(--google-surface);
  }

  .auth-wrapper {
    max-width: 100%;
    min-height: 100vh;
    justify-content: space-between;
  }

  .auth-card {
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 32px 24px 24px 24px;
    flex: 1;
  }

  .google-title-row {
    gap: 10px;
  }

  .google-brand-logo {
    width: 32px;
    height: 32px;
  }

  .google-title {
    font-size: 20px;
  }

  .google-subtitle {
    font-size: 14px;
  }

  .otp-box {
    width: 44px;
    height: 52px;
    font-size: 20px;
  }

  .google-footer {
    padding: 16px 24px 24px 24px;
    margin-top: 0;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .google-footer-links {
    gap: 20px;
  }

  .legal-wrapper {
    max-width: 100%;
    min-height: 100vh;
  }

  .legal-card {
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 24px 16px;
  }
}

@media (max-width: 360px) {
  .otp-box {
    width: 38px;
    height: 48px;
    font-size: 18px;
  }
}

/* ── Legal & Help Reading Views ────────────────────────────────────────────── */

.legal-wrapper {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}

.legal-card {
  width: 100%;
  background: var(--google-surface);
  border-radius: var(--radius-card);
  padding: 40px;
  border: 1px solid var(--google-border-light);
  box-shadow: var(--shadow-card);
}

.legal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--google-text-secondary);
}

.legal-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--google-canvas);
  border: 1px solid var(--google-border);
  font-size: 12px;
  font-weight: 500;
  color: var(--google-text-primary);
}

.legal-summary {
  background: var(--google-canvas);
  border-left: 4px solid var(--google-blue);
  padding: 14px 18px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--google-text-primary);
}

.legal-section {
  margin-bottom: 28px;
}

.legal-section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--google-text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.1px;
}

.legal-paragraph {
  font-size: 14px;
  line-height: 1.65;
  color: var(--google-text-secondary);
  margin-bottom: 10px;
}

.legal-list {
  padding-left: 20px;
  margin: 10px 0 16px 0;
  color: var(--google-text-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.legal-list li {
  margin-bottom: 6px;
}

.legal-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--google-border-subtle);
  padding-bottom: 12px;
}

.legal-tab-link {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--google-text-secondary);
  text-decoration: none;
  border-radius: 16px;
  transition: all 0.15s ease;
}

.legal-tab-link:hover {
  background: var(--google-canvas);
  color: var(--google-text-primary);
}

.legal-tab-link.is-active {
  background: var(--google-blue);
  color: #ffffff;
  font-weight: 500;
}

.legal-tab-link.is-active:hover {
  background: var(--google-blue-hover);
  color: #ffffff;
}

.legal-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
  color: var(--google-text-secondary);
  font-size: 14px;
}

/* ==========================================================================
   Google-Style Account Switcher & Avatar Dropdown
   ========================================================================== */

.g-account-switcher-wrap {
  position: relative;
  display: inline-block;
}

.g-account-avatar-btn {
  background: none;
  border: none;
  padding: 2px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.g-account-avatar-btn:hover,
.g-account-avatar-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--google-blue-surface);
  transform: scale(1.05);
}

.g-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  user-select: none;
}

.g-account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--google-surface);
  border-radius: 20px;
  border: 1px solid var(--google-border-light);
  box-shadow: 0 8px 28px rgba(60, 64, 67, 0.22);
  z-index: 1000;
  display: none;
  overflow: hidden;
  animation: gDropdownFadeIn 0.15s ease;
}

.g-account-dropdown.is-open {
  display: block;
}

@keyframes gDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.g-account-dropdown-header {
  padding: 24px 20px 18px 20px;
  text-align: center;
  background: var(--google-canvas);
  border-bottom: 1px solid var(--google-border-light);
}

.g-dropdown-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  margin: 0 auto 12px auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  user-select: none;
}

.g-dropdown-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--google-text-primary);
  line-height: 1.3;
}

.g-dropdown-email {
  font-size: 13px;
  color: var(--google-text-secondary);
  margin-top: 2px;
  word-break: break-all;
}

.g-dropdown-badge-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.g-account-badge-active {
  display: inline-block;
  background: var(--google-blue-surface);
  color: var(--google-blue);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.g-account-badge-verified {
  display: inline-block;
  background: var(--google-success-bg);
  color: var(--google-success);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

.g-account-dropdown-body {
  padding: 8px 0;
  max-height: 280px;
  overflow-y: auto;
}

.g-account-list-label {
  padding: 8px 16px 4px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--google-text-secondary);
  letter-spacing: 0.6px;
}

.g-account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.g-account-item:hover {
  background: var(--google-canvas);
}

.g-account-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.g-account-item-info {
  flex: 1;
  min-width: 0;
}

.g-account-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--google-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-account-item-sub {
  font-size: 12px;
  color: var(--google-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-dropdown-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--google-text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-top: 1px solid var(--google-border-light);
  transition: background 0.15s ease;
}

.g-dropdown-action-btn:hover {
  background: var(--google-canvas);
}

.g-account-dropdown-footer {
  padding: 12px 16px;
  background: var(--google-canvas);
  border-top: 1px solid var(--google-border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.g-dropdown-signout-btn {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--google-border);
  background: var(--google-surface);
  border-radius: 6px;
  color: var(--google-text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.g-dropdown-signout-btn:hover {
  background: #f1f3f4;
  border-color: var(--google-text-secondary);
}

.g-dropdown-signout-all-btn {
  width: 100%;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--google-error);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
}

.g-dropdown-signout-all-btn:hover {
  background: var(--google-error-bg);
}

/* ==========================================================================
   Profile Dashboard Layout
   ========================================================================== */

.profile-container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0;
  border-bottom: 1px solid var(--google-border-light);
  margin-bottom: 12px;
}

.profile-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.profile-brand-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--google-text-primary);
  letter-spacing: -0.2px;
}

.profile-hero-card {
  background: var(--google-surface);
  border-radius: var(--radius-card);
  padding: 36px 40px;
  border: 1px solid var(--google-border-light);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 32px;
}

.profile-hero-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  user-select: none;
}

.profile-hero-info {
  flex: 1;
}

.profile-hero-name {
  font-size: 26px;
  font-weight: 600;
  color: var(--google-text-primary);
  line-height: 1.25;
}

.profile-hero-sub {
  font-size: 15px;
  color: var(--google-text-secondary);
  margin-top: 4px;
}

.profile-hero-uuid-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.profile-hero-uuid {
  font-family: monospace;
  font-size: 13px;
  color: var(--google-text-secondary);
  background: var(--google-canvas);
  padding: 3px 8px;
  border-radius: 4px;
}

.profile-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--google-blue);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
}

.profile-copy-btn:hover {
  background: var(--google-blue-surface);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.profile-card {
  background: var(--google-surface);
  border-radius: var(--radius-card);
  padding: 32px;
  border: 1px solid var(--google-border-light);
  box-shadow: var(--shadow-card);
}

.profile-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--google-border-light);
  padding-bottom: 14px;
}

.profile-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--google-text-primary);
}

.profile-data-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-data-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-data-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--google-text-secondary);
}

.profile-data-val-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-data-val {
  font-size: 15px;
  color: var(--google-text-primary);
  font-weight: 500;
}

.profile-pill-verified {
  background: var(--google-success-bg);
  color: var(--google-success);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.profile-pill-unverified {
  background: var(--google-warning-bg);
  color: var(--google-warning);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.profile-deletion-banner {
  background: var(--google-error-bg);
  border: 1px solid var(--google-error);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.profile-deletion-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--google-error);
}

.profile-deletion-desc {
  font-size: 13px;
  color: var(--google-text-primary);
  margin-top: 4px;
}

.profile-btn-cancel-del {
  background: var(--google-surface);
  border: 1px solid var(--google-error);
  color: var(--google-error);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.profile-btn-cancel-del:hover {
  background: var(--google-error);
  color: #ffffff;
}

/* ── Multi-Account Management Section & Responsive Controls ───────────────── */

.profile-accounts-card {
  grid-column: 1 / -1;
}

.profile-accounts-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--google-border-light);
  padding-bottom: 16px;
}

.profile-accounts-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-accounts-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--google-text-secondary);
  background: var(--google-canvas);
  border: 1px solid var(--google-border-light);
  padding: 2px 8px;
  border-radius: 12px;
  line-height: 1.4;
}

.profile-add-account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.profile-add-account-btn:hover {
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.35);
  transform: translateY(-1px);
}

.profile-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--google-canvas);
  border: 1px solid var(--google-border-light);
  border-radius: 14px;
  transition: all 0.2s ease;
}

.profile-account-card.is-active {
  background: var(--google-blue-surface);
  border-color: rgba(26, 115, 232, 0.35);
}

.profile-account-card:hover {
  border-color: var(--google-blue);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.profile-account-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.profile-account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  user-select: none;
}

.profile-account-details {
  min-width: 0;
  flex: 1;
}

.profile-account-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-account-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--google-text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.profile-account-sub {
  font-size: 12px;
  color: var(--google-text-secondary);
  margin-top: 2px;
  word-break: break-all;
}

.profile-account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.profile-account-btn-switch {
  background: var(--google-surface);
  color: var(--google-blue);
  border: 1px solid var(--google-blue);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-account-btn-switch:hover {
  background: var(--google-blue);
  color: #ffffff;
}

.profile-account-btn-signout {
  background: transparent;
  border: 1px solid transparent;
  color: var(--google-error);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-account-btn-signout:hover {
  background: var(--google-error-bg);
  border-color: rgba(217, 48, 37, 0.2);
}

/* Bottom "Add another account" item */
.profile-account-add-card {
  margin-top: 4px;
}

.profile-account-add-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px dashed var(--google-border);
  background: var(--google-surface);
  text-decoration: none;
  color: var(--google-text-primary);
  transition: all 0.2s ease;
}

.profile-account-add-link:hover {
  border-color: var(--google-blue);
  background: var(--google-blue-surface);
  color: var(--google-blue);
}

.profile-account-add-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--google-blue-surface);
  color: var(--google-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.profile-account-add-link:hover .profile-account-add-icon {
  background: var(--google-blue);
  color: #ffffff;
}

.profile-account-add-text {
  min-width: 0;
  flex: 1;
}

.profile-account-add-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--google-blue);
}

.profile-account-add-desc {
  font-size: 12px;
  color: var(--google-text-secondary);
  margin-top: 2px;
}

@media (max-width: 680px) {
  .profile-accounts-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .profile-accounts-title-wrap {
    justify-content: space-between;
    width: 100%;
  }

  .profile-add-account-btn {
    width: 100%;
    padding: 11px 16px;
    font-size: 14px;
    border-radius: 8px;
  }

  .profile-account-card {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    gap: 12px;
  }

  .profile-account-main {
    width: 100%;
  }

  .profile-account-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--google-border-light);
    padding-top: 10px;
  }

  .profile-account-btn-switch {
    flex: 1;
    padding: 9px 14px;
    font-size: 13.5px;
    text-align: center;
  }

  .profile-account-btn-signout {
    padding: 9px 14px;
    font-size: 13.5px;
  }

  .profile-account-add-link {
    padding: 12px 14px;
  }
}

@media (max-width: 600px) {
  .profile-hero-card {
    flex-direction: column;
    text-align: center;
    padding: 28px 20px;
    gap: 16px;
  }
  .profile-hero-uuid-row {
    justify-content: center;
  }
  .profile-deletion-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 440px) {
  body {
    padding: 12px 10px 32px 10px !important;
  }

  .profile-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .profile-card {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .profile-card-title {
    font-size: 16px;
  }

  .profile-account-card {
    padding: 12px;
  }

  .profile-account-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .profile-account-btn-switch,
  .profile-account-btn-signout {
    width: 100%;
    text-align: center;
    padding: 9px 12px;
  }

  .profile-account-add-desc {
    display: none;
  }
}

/* ── Verification Modal & Buttons ───────────────────────────────────────────── */

.profile-verify-btn {
  background: var(--google-blue-surface);
  color: var(--google-blue);
  border: 1px solid var(--google-blue);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.profile-verify-btn:hover {
  background: var(--google-blue);
  color: #ffffff;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(31, 31, 31, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--google-surface);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  border: 1px solid var(--google-border-light);
  position: relative;
  animation: modalSlideUp 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--google-text-primary);
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--google-text-secondary);
  line-height: 1.4;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--google-text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: background-color 0.15s ease;
}

.modal-close-btn:hover {
  background-color: var(--google-canvas);
  color: var(--google-text-primary);
}

.modal-channel-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--google-blue-surface);
  color: var(--google-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--google-blue);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s ease-in-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.skip-link:focus {
  top: 16px;
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}


