/* Sign-in and migration screens, shown in place of the app. */

/* Authentication Overlay Screen.

   The backdrop reads through --auth-scrim rather than a literal light gradient,
   so it follows the theme: a hard-coded pale backdrop would leave a dark card
   sitting in a pale halo. */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--auth-scrim);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.5rem;
}

.auth-card {
  background: var(--bg-frost-strong);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-title {
  font-family: var(--font-display);
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.auth-subtitle {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

/* Why you are looking at the sign-in screen, when there is a reason. Informational
   rather than alarming: an expired session is the system working as designed, and the
   only thing being asked of you is already the one control on the card. */
.auth-notice {
  margin-top: 1.25rem;
  padding: 0.6rem 0.85rem;
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: var(--fs-meta);
  line-height: 1.45;
  color: var(--ink-2);
}

.auth-actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

/* The Google sign-in button. Drawn by this page rather than by Google's widget — on an
   iPhone the widget always lived in a cross-origin iframe whose page was white — and
   sized to Google's guidelines: 40px tall, 20px logo, 12px sides, 10px between logo
   and label, a medium weight at 14px. */
.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gbtn-border);
  background: var(--gbtn-bg);
  color: var(--gbtn-fg);
  /* Google's guidelines ask for Roboto Medium. css/fonts.css carries that one weight,
     Latin only, for this button; until it arrives the button is in the text face. */
  font-family: 'Roboto', var(--font-text);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0.25px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.google-signin-logo {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

/* Google's hover and press states are a wash of the label colour over the fill, which
   works on both grounds without a second set of colours. */
.google-signin-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gbtn-fg);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.google-signin-btn:hover::after { opacity: 0.08; }
.google-signin-btn:active::after { opacity: 0.12; }

.google-signin-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

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

.google-signin-btn:disabled::after { display: none; }

.auth-hint {
  font-size: var(--fs-meta);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* Full-Screen Blocking Migration Screen */
.blocking-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.blocking-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sheet);
  border: 1px solid var(--line);
  padding: 2.75rem 2.25rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  animation: modalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.migration-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--tint-blue-bg);
  color: var(--accent-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.75rem;
}

.migration-icon-wrapper.error {
  background: var(--tint-red-bg);
  color: var(--accent-red);
}

.migration-spin-svg {
  animation: spin 2s linear infinite;
}

.blocking-title {
  font-family: var(--font-display);
  font-size: var(--fs-title);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.blocking-subtitle {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-track);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-blue-hover));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  position: relative;
}

/* The upgrade failed: the bar fills in the error red. */
.progress-fill.failed {
  background: var(--crit);
}

.progress-fill.indeterminate {
  width: 100%;
  background: linear-gradient(90deg, var(--bg-track) 0%, var(--accent-blue) 50%, var(--bg-track) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.blocking-footnote {
  font-size: var(--fs-label);
  color: var(--text-muted);
  line-height: 1.4;
}
