/*
 Author: abhik pramanik
 Change Date: 2026-10-02
 Change details: Sticky product header; Gmail + theme + logout cluster
   (no overlap). Prior: Applies theme-aware blue tokens to forms, success,
   strength, and authenticated-shell accent states.
 Purpose: Labels, focus rings, ≥44px targets, and blue accent presentation
   on login/signup/profile and the placeholder dashboard header.
 Inputs: tokens.css custom properties
 Outputs: auth + dashboard styles
*/

.auth-col {
  width: 100%;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: var(--form-col-max);
  width: 100%;
}

.welcome-page--profile .auth-form,
.welcome-page--profile .auth-alert {
  max-width: var(--form-col-profile-max);
}

.auth-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-input,
.btn-google,
.auth-submit,
.dash-logout {
  min-height: 44px;
}

.auth-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--control-bg);
  color: var(--text-primary);
  font: inherit;
  color-scheme: inherit;
}

select.auth-input {
  cursor: pointer;
}

.auth-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-stepper-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--control-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 1.2rem;
}

.auth-stepper-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-stepper-value {
  width: 72px;
  text-align: center;
}

.auth-helper {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-logout-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 0 8px;
  max-width: var(--form-col-profile-max);
}

.auth-username {
  color: var(--link);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.auth-logout-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--link);
  font: inherit;
  cursor: pointer;
  min-height: 44px;
}

.auth-input:focus-visible,
.btn-google:focus-visible,
.auth-submit:focus-visible,
.dash-logout:focus-visible,
.auth-stepper-btn:focus-visible,
.auth-logout-link:focus-visible,
.auth-forgot a:focus-visible,
.auth-footer a:focus-visible,
.auth-reset-link a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.auth-forgot {
  margin: 0;
  text-align: right;
}

.auth-forgot a,
.auth-footer a,
.auth-reset-link a {
  color: var(--link);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-or {
  max-width: var(--form-col-max);
  margin: 20px 0;
  color: var(--text-secondary);
  text-align: center;
  position: relative;
}

.auth-or::before,
.auth-or::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--border);
}

.auth-or::before {
  left: 0;
}

.auth-or::after {
  right: 0;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: var(--form-col-max);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--text-primary);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
}

.btn-google:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.btn-google:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-google-wrap {
  width: 100%;
  max-width: var(--form-col-max);
}

.auth-last-used {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.62);
}

.auth-modal {
  position: relative;
  width: min(100%, 420px);
  padding: 28px 24px 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.auth-modal-close:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.btn-google-mark {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #4285f4;
  font-size: 0.8rem;
  font-weight: 700;
}

.auth-footer {
  margin: 20px 0 0;
  color: var(--text-secondary);
}

.auth-alert {
  max-width: var(--form-col-max);
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #7f1d1d;
  background: rgba(127, 29, 29, 0.25);
  color: var(--text-primary);
}

.auth-alert-ok {
  border-color: var(--accent-blue-bottom);
  background: color-mix(in srgb, var(--accent-blue-top) 16%, transparent);
}

.auth-reset-link {
  max-width: var(--form-col-max);
  margin: 0 0 16px;
  word-break: break-all;
}

.strength {
  max-width: var(--form-col-max);
}

.strength-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.strength-seg {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
}

.strength-seg.is-1 {
  background: #f87171;
}

.strength-seg.is-2 {
  background: #fbbf24;
}

.strength-seg.is-3 {
  background: var(--accent-gradient);
}

.strength-seg.is-4 {
  background: var(--accent-blue-bottom);
}

.strength-label {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.dash-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: welcome-fade-in 0.55s ease-out;
}

.dash-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dash-logo {
  width: 32px;
  height: 32px;
}

.dash-product {
  font-weight: 600;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dash-user .btn-primary,
.dash-user .btn-secondary,
.dash-user .theme-toggle {
  width: auto;
  min-width: 44px;
}

.dash-gmail {
  min-width: 132px;
  padding: 8px 16px;
}

.dash-gmail--connected,
.dash-gmail:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dash-username {
  color: var(--link);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(52vw, 420px);
}

.dash-logout {
  min-width: 120px;
  padding: 8px 16px;
}

.dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 64px;
}

.dash-empty,
.dash-stub-card {
  width: min(100%, 560px);
  padding: 32px 28px;
  border-radius: 16px;
  background: var(--bg-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
}

.dash-title {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}

.dash-copy {
  margin: 0;
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .dash-page {
    animation: none;
  }
}

@media (max-width: 720px) {
  .dash-header {
    flex-wrap: wrap;
  }

  .dash-username {
    max-width: 100%;
  }

  .auth-form,
  .btn-google,
  .auth-google-wrap,
  .auth-or,
  .auth-alert,
  .auth-reset-link,
  .strength,
  .welcome-page--profile .auth-form,
  .welcome-page--profile .auth-alert,
  .auth-logout-row {
    max-width: none;
  }

  .auth-name-row {
    grid-template-columns: 1fr;
  }
}
