/* AgendaCraft Auth Page Styles
   Uses unified design tokens from @agendacraft/theme */
@import url("./design-tokens.43dc89287417.css");

/* =============================================================================
   Local Variables (mapped from unified tokens)
   These provide shorter aliases for commonly used tokens in auth pages
   ============================================================================= */
:root {
  /* Map to unified tokens for easier usage.
     Accent points at the brand primary so links/focus/buttons match the
     Ant Design palette used by apps/agenda-web. */
  --auth-color-text-primary: var(--ac-color-text-primary);
  --auth-color-text-secondary: var(--ac-color-text-secondary);
  --auth-color-text-placeholder: var(--ac-color-text-placeholder);
  --auth-color-accent: var(--ac-color-brand-primary);
  --auth-color-accent-hover: var(--ac-color-brand-primary-hover);
  --auth-color-input-bg: var(--ac-color-input-background);
  --auth-color-input-bg-hover: var(--ac-color-input-background-hover);

  /* Auth surfaces. Antd renders a white Card resting on a subtle inset fill.
     No unified white-container token exists yet, so the literal lives here as a
     single source rather than scattered across rules; the sunken fill maps to
     an existing token and its hover is derived from it. */
  --auth-color-surface: #ffffff;
  --auth-color-surface-sunken: var(--ac-color-bg-app);
  --auth-color-surface-sunken-hover: color-mix(in srgb, var(--ac-color-bg-app), black 4%);

  --auth-shadow-minimal: var(--ac-shadow-minimal);
  --auth-shadow-focus: var(--ac-shadow-focus);
  /* Ant Design's default 2px focus glow: primary @ 10% opacity. */
  --auth-shadow-focus-antd: 0 0 0 2px
    color-mix(in srgb, var(--ac-color-brand-primary) 10%, transparent);

  /* Ant Design control sizing — matches the project's spacing.semantic.controlHeight. */
  --auth-control-height: 36px;
  --auth-radius-control: 6px;
  --auth-font-family-antd:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

  --auth-spacing-xs: var(--ac-spacing-xs);
  --auth-spacing-sm: var(--ac-spacing-sm);
  --auth-spacing-md: var(--ac-spacing-md);
  --auth-spacing-lg: var(--ac-spacing-lg);
  --auth-spacing-xl: var(--ac-spacing-xl);
  --auth-spacing-2: var(--ac-spacing-compact-padding);
  --auth-spacing-3: 0.75rem;
  --auth-spacing-4: var(--ac-spacing-md);
  --auth-spacing-5: var(--ac-spacing-card-padding-large);
  --auth-spacing-6: var(--ac-spacing-lg);
  --auth-spacing-7: 1.75rem;
  --auth-spacing-8: var(--ac-spacing-major-section);
  --auth-spacing-10: 2.5rem;

  --auth-font-size-title: var(--ac-font-size-page-header);
  --auth-font-size-subtitle: var(--ac-font-size-section-header);
  --auth-font-weight-semibold: var(--ac-font-weight-semibold);
  --auth-line-height-tight: var(--ac-line-height-tight);
  --auth-line-height-relaxed: var(--ac-line-height-relaxed);

  --auth-radius-md: var(--ac-radius-md);
  --auth-transition-fast: var(--ac-transition-fast);

  /* Social Provider Buttons - shared */
  --provider-bg: white;
  --provider-icon-left: 14px;

  /* Google Sign-in Button - follows Google branding guidelines */
  --google-bg-hover: #f8faff;
  --google-border: #dadce0;
  --google-border-hover: #d2e3fc;
  --google-border-focus: #4285f4;
  --google-text: #3c4043;
  --google-shadow-hover: 0 1px 3px rgba(66, 133, 244, 0.15);
  --google-shadow-focus: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

:root[data-theme="dark"] {
  --auth-color-surface: var(--ac-color-bg-surface);
  --auth-color-surface-sunken: var(--ac-color-bg-app);
  --auth-color-surface-sunken-hover: color-mix(in srgb, var(--ac-color-bg-app), white 6%);
  --provider-bg: var(--auth-color-surface);
  --google-bg-hover: color-mix(in srgb, var(--auth-color-surface), white 6%);
  --google-border: var(--ac-color-border-default);
  --google-border-hover: var(--ac-color-brand-border);
  --google-text: var(--auth-color-text-primary);
}

/* =============================================================================
   Mobile baseline
   - Ensure >=16px text (prevents iOS input zoom)
   ============================================================================= */
html {
  font-size: 16px;
}

body {
  font-size: 1rem;
  font-family: var(--auth-font-family-antd);
}

/* =============================================================================
   Margin Utilities
   ============================================================================= */
.mr-2 {
  margin-right: var(--auth-spacing-2);
}
.mr-4 {
  margin-right: var(--auth-spacing-4);
}
.mb-3 {
  margin-bottom: var(--auth-spacing-3);
}
.mb-4 {
  margin-bottom: var(--auth-spacing-sm);
}
.mb-5 {
  margin-bottom: var(--auth-spacing-md);
}
.mb-6 {
  margin-bottom: var(--auth-spacing-lg);
}
.mb-8 {
  margin-bottom: var(--auth-spacing-xl);
}
.mb-10 {
  margin-bottom: var(--auth-spacing-10);
}
.mt-2 {
  margin-top: var(--auth-spacing-2);
}
.mt-8 {
  margin-top: var(--auth-spacing-8);
}

/* =============================================================================
   Gap Utilities
   ============================================================================= */
.gap-2 {
  gap: var(--auth-spacing-2, 0.5rem) !important;
}
.gap-3 {
  gap: var(--auth-spacing-3, 0.75rem) !important;
}
.gap-4 {
  gap: var(--auth-spacing-4, 1rem) !important;
}
.gap-5 {
  gap: var(--auth-spacing-5, 1.25rem) !important;
}
.gap-6 {
  gap: var(--auth-spacing-6, 1.5rem) !important;
}
.gap-8 {
  gap: var(--auth-spacing-8, 2rem) !important;
}

/* =============================================================================
   Grid Utilities
   ============================================================================= */
.grid {
  display: grid;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* =============================================================================
   Sizing Utilities
   ============================================================================= */
.w-4 {
  width: 1rem;
}
.h-4 {
  height: 1rem;
}
.w-5 {
  width: 1.25rem;
}
.h-5 {
  height: 1.25rem;
}
.w-6 {
  width: 1.5rem;
}
.h-6 {
  height: 1.5rem;
}
.w-8 {
  width: 2rem;
}
.h-8 {
  height: 2rem;
}
.w-12 {
  width: 3rem;
}
.h-12 {
  height: 3rem !important;
  min-height: 3rem !important;
}
.max-w-2xl {
  max-width: 42rem;
}
.max-w-3xl {
  max-width: 48rem;
}
.h-11 {
  height: 2.75rem;
}
.h-13 {
  height: 3.25rem !important;
  min-height: 3.25rem !important;
}

/* =============================================================================
   Spacing Utilities
   ============================================================================= */
.p-1\.5 {
  padding: 0.375rem;
}
.p-2 {
  padding: 0.5rem;
}
.p-3 {
  padding: 0.75rem;
}
.p-4 {
  padding: 1rem;
}
.p-5 {
  padding: var(--auth-spacing-5);
}
.p-6 {
  padding: var(--auth-spacing-6);
}
.p-7 {
  padding: var(--auth-spacing-7);
}
.p-8 {
  padding: 2rem;
}
.pt-1 {
  padding-top: 0.25rem;
}
.pt-2 {
  padding-top: 0.5rem;
}
.pt-4 {
  padding-top: 1rem;
}
.pt-6 {
  padding-top: 1.5rem;
}
.pt-7 {
  padding-top: 1.75rem;
}
.pb-3 {
  padding-bottom: 0.75rem;
}
.pb-4 {
  padding-bottom: 1rem;
}
.space-y-1 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
}
.space-y-8 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(2rem * var(--tw-space-y-reverse));
}

/* =============================================================================
   Responsive Utilities (Desktop First overrides)
   ============================================================================= */
@media (min-width: 640px) {
  .sm\:p-8 {
    padding: 2rem;
  }
  .sm\:flex-row {
    flex-direction: row;
  }
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sm\:text-left {
    text-align: left;
  }
  .sm\:hidden {
    display: none;
  }
}

@media (min-width: 768px) {
  .md\:mt-12 {
    margin-top: 3rem;
  }
  .md\:p-10 {
    padding: 2.5rem;
  }
  .md\:w-10\/12 {
    width: 83.333333%;
  }
}

@media (min-width: 1024px) {
  .lg\:mt-20 {
    margin-top: 5rem;
  }
  .lg\:w-7\/12 {
    width: 58.333333%;
  }
}

@media (min-width: 1280px) {
  .xl\:w-5\/12 {
    width: 41.666667%;
  }
}

/* =============================================================================
   Flexbox Utilities
   ============================================================================= */
.inline-flex {
  display: inline-flex;
}
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.flex-1 {
  flex: 1 1 0%;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.shrink-0 {
  flex-shrink: 0;
}

/* =============================================================================
   List Utilities
   ============================================================================= */
.list-disc {
  list-style-type: disc;
}
.list-inside {
  list-style-position: inside;
}

/* =============================================================================
   Typography Utilities
   ============================================================================= */
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}
.font-black {
  font-weight: 900;
}
.font-mono {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
}
.text-center {
  text-align: center;
}
.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}
.text-4xl {
  font-size: 2.25rem;
  line-height: 2.5rem;
}
.tracking-tight {
  letter-spacing: -0.025em;
}
.leading-relaxed {
  line-height: 1.625;
}
.leading-snug {
  line-height: 1.375;
}
.opacity-90 {
  opacity: 0.9;
}
.opacity-80 {
  opacity: 0.8;
}

/* =============================================================================
   Border Utilities
   ============================================================================= */
.border {
  border-width: 1px;
}
.border-2 {
  border-width: 2px;
}
.border-l-4 {
  border-left-width: 4px;
}
.border-t {
  border-top-width: 1px;
}
.border-base-200 {
  border-color: var(--b2, #e5e7eb);
}
.border-base-300 {
  border-color: var(--b3, #f5f5f5);
}
.border-error {
  border-color: var(--ac-color-semantic-overdue);
}
.border-error\/10 {
  border-color: color-mix(in oklch, var(--ac-color-semantic-overdue) 10%, transparent);
}
.border-error\/20 {
  border-color: color-mix(in oklch, var(--ac-color-semantic-overdue) 20%, transparent);
}
.rounded-full {
  border-radius: 9999px;
}
.rounded-lg {
  border-radius: 0.5rem;
}
.rounded-xl {
  border-radius: 0.75rem;
}
.rounded-2xl {
  border-radius: 1rem;
}
.rounded-3xl {
  border-radius: 1.5rem;
}

/* =============================================================================
   Color Utilities
   ============================================================================= */
.text-error {
  color: var(--ac-color-semantic-overdue);
}
.text-error-content {
  color: var(--ac-color-semantic-overdue-content);
}
.text-base-content {
  color: var(--bc, #111827);
}
.text-base-content\/80 {
  color: color-mix(in oklch, oklch(var(--bc, 0.278 0.029 256.848)) 80%, transparent);
}
.text-base-content\/70 {
  color: color-mix(in oklch, oklch(var(--bc, 0.278 0.029 256.848)) 70%, transparent);
}
.text-base-content\/60 {
  color: color-mix(in oklch, oklch(var(--bc, 0.278 0.029 256.848)) 60%, transparent);
}
.bg-base-100 {
  background-color: var(--b1, #ffffff);
}
.bg-base-50 {
  background-color: var(--ac-color-background-subtle, #f9fafb);
}
.bg-error\/5 {
  background-color: color-mix(in oklch, var(--ac-color-semantic-overdue) 5%, transparent);
}
.bg-error\/10 {
  background-color: color-mix(in oklch, var(--ac-color-semantic-overdue) 10%, transparent);
}
.bg-error\/90 {
  background-color: color-mix(in oklch, var(--ac-color-semantic-overdue) 90%, transparent);
}
.hover\:bg-base-100:hover {
  background-color: var(--b1, #ffffff);
}
.hover\:bg-base-200:hover {
  background-color: var(--b2, #e5e7eb);
}
.shadow-red-500\/20 {
  --tw-shadow-color: rgba(239, 68, 68, 0.2);
  box-shadow:
    var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-sm {
  --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  box-shadow:
    var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-md {
  --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  box-shadow:
    var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-lg {
  --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  box-shadow:
    var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.hover\:shadow-md:hover {
  --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  box-shadow:
    var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.hover\:shadow-lg:hover {
  --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  box-shadow:
    var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.transition-shadow {
  transition-property: box-shadow;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.transition-colors {
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* =============================================================================
   Focus Ring Utilities
   ============================================================================= */
.focus\:outline-none:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.focus\:ring-2:focus {
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width)
    var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width))
    var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}
.focus\:ring-error\/30:focus {
  --tw-ring-color: color-mix(in oklch, var(--ac-color-semantic-overdue) 50%, transparent);
}
.focus\:ring-accent\/30:focus {
  --tw-ring-color: color-mix(in oklch, var(--ac-color-accent-default) 50%, transparent);
}

/* =============================================================================
   Input State Utilities
   ============================================================================= */
.input-error {
  border-color: var(--ac-color-semantic-overdue) !important;
}
.input-success {
  border-color: var(--ac-color-semantic-success) !important;
}
.hover\:border-base-300:hover {
  border-color: var(--b3, #f5f5f5);
}

/* =============================================================================
   Accessibility
   ============================================================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* =============================================================================
   Auth Page Styles
   ============================================================================= */

/* Typography */
.auth-card-shadow {
  background-color: var(--auth-color-surface);
  box-shadow: var(--auth-shadow-minimal);
  border: 1px solid var(--ac-color-brand-card-border);
}

/* Sub-cards inside the manage card surface. The compiled allauth_ui
   CSS doesn't ship `bg-base-200/30`, so without this every nested
   `.auth-card-shadow` was rendering white-on-white. Use a flat neutral
   fill (or red fill for the danger row) and drop the doubled-up
   border/shadow on the inner cards. */
.auth-card-shadow .auth-card-shadow,
.auth-card-shadow .bg-base-100 {
  background-color: var(--auth-color-surface-sunken);
  border: 0;
  box-shadow: none;
}

a.auth-card-shadow:not([class*="bg-error"]):hover {
  background-color: var(--auth-color-surface-sunken-hover);
}

.auth-card-shadow .auth-card-shadow[class*="bg-error"] {
  background-color: color-mix(
    in oklch,
    var(--ac-color-semantic-overdue) 8%,
    var(--auth-color-surface)
  );
}

a.auth-card-shadow[class*="bg-error"]:hover {
  background-color: color-mix(
    in oklch,
    var(--ac-color-semantic-overdue) 14%,
    var(--auth-color-surface)
  );
}

.auth-title {
  font-size: var(--auth-font-size-title);
  font-weight: var(--auth-font-weight-semibold);
  letter-spacing: -0.5px;
  line-height: var(--auth-line-height-tight);
  color: var(--auth-color-text-primary);
  margin-bottom: var(--auth-spacing-xs);
}

.auth-subtitle {
  font-size: max(var(--auth-font-size-subtitle), 1rem);
  color: var(--auth-color-text-secondary);
  line-height: var(--auth-line-height-relaxed);
  letter-spacing: 0.25px;
  margin-bottom: var(--auth-spacing-sm);
}

/* Antd Typography.Title level=2 — used for bare <h1> inside auth surfaces. */
.auth-container > h1,
.auth-card-shadow > h1 {
  font-size: var(--auth-font-size-title);
  font-weight: var(--auth-font-weight-semibold);
  line-height: var(--auth-line-height-tight);
  color: var(--auth-color-text-primary);
  letter-spacing: -0.3px;
  margin-bottom: var(--auth-spacing-md);
}

/* Container — modeled on antd Card: white surface, 1px #d9d9d9 border, 8px radius. */
.auth-container {
  background-color: var(--auth-color-surface);
  border: 1px solid var(--ac-color-brand-card-border);
  border-radius: var(--auth-radius-md);
  box-shadow: var(--auth-shadow-minimal);
}

/* Tighten card padding on desktop to antd's ~24px (was 2.5rem from md:p-10). */
@media (min-width: 768px) {
  .auth-container.md\:p-10,
  .auth-card-shadow.md\:p-10 {
    padding: var(--auth-spacing-lg);
  }

  /* Cap the manage content card so form pages don't span the full
     1280px container — reads like a typical settings page. */
  .manage-layout > .auth-card-shadow {
    box-sizing: border-box;
    max-width: 34rem;
    margin-left: auto;
    margin-right: auto;
  }

  .manage-layout > .account-settings-card {
    max-width: 40rem;
  }
}

/* =============================================================================
   Account settings landing
   ============================================================================= */
.account-settings-page {
  padding-top: var(--auth-spacing-md);
}

.account-settings-card {
  margin-top: var(--auth-spacing-lg);
}

.account-settings-card-header {
  margin-bottom: var(--auth-spacing-xl);
}

.account-settings-section + .account-settings-section {
  margin-top: var(--auth-spacing-xl);
}

.account-settings-section-title {
  margin: 0 0 var(--auth-spacing-sm);
  color: var(--auth-color-text-secondary);
  font-size: var(--ac-font-size-caption);
  font-weight: var(--auth-font-weight-semibold);
}

.account-settings-panel {
  padding: var(--auth-spacing-lg);
  border-radius: var(--auth-radius-md);
  background-color: var(--auth-color-surface-sunken);
}

.account-settings-panel-header {
  display: flex;
  align-items: flex-start;
  gap: var(--auth-spacing-md);
  margin-bottom: var(--auth-spacing-lg);
}

.account-settings-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: var(--auth-radius-control);
  color: var(--auth-color-text-secondary);
  background-color: var(--auth-color-surface);
}

.account-settings-icon--primary {
  color: var(--auth-color-accent);
  background-color: color-mix(in srgb, var(--auth-color-accent) 10%, var(--auth-color-surface));
}

.account-settings-icon--danger {
  color: var(--ac-color-semantic-overdue);
  background-color: color-mix(
    in srgb,
    var(--ac-color-semantic-overdue) 10%,
    var(--auth-color-surface)
  );
}

.account-settings-item-title {
  display: block;
  color: var(--auth-color-text-primary);
  font-size: var(--ac-font-size-body);
  font-weight: var(--auth-font-weight-semibold);
  line-height: var(--auth-line-height-tight);
}

.account-settings-item-copy {
  display: block;
  margin-top: 0.25rem;
  color: var(--auth-color-text-secondary);
  font-size: var(--ac-font-size-caption);
  line-height: var(--auth-line-height-relaxed);
}

.account-settings-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--auth-spacing-sm);
}

.account-settings-button-row .btn {
  flex: 1 1 12rem;
}

.account-settings-grid {
  display: grid;
  gap: var(--auth-spacing-sm);
}

.account-settings-tile {
  display: flex;
  align-items: center;
  gap: var(--auth-spacing-md);
  min-height: 4.5rem;
  padding: var(--auth-spacing-md);
  border-radius: var(--auth-radius-md);
  color: inherit;
  text-decoration: none;
  background-color: var(--auth-color-surface-sunken);
  transition:
    background-color var(--auth-transition-fast),
    box-shadow var(--auth-transition-fast);
}

.account-settings-tile:hover,
.account-settings-tile:focus-visible {
  background-color: var(--auth-color-surface-sunken-hover);
  box-shadow: inset 0 0 0 1px var(--ac-color-brand-card-border);
  outline: none;
}

.account-settings-tile-content {
  min-width: 0;
  flex: 1 1 auto;
}

.account-settings-tile > svg {
  flex: 0 0 auto;
  color: var(--auth-color-text-secondary);
  transition: color var(--auth-transition-fast);
}

.account-settings-tile:hover > svg,
.account-settings-tile:focus-visible > svg {
  color: var(--auth-color-accent);
}

.account-settings-danger-zone {
  padding-top: var(--auth-spacing-lg);
  border-top: 1px solid var(--ac-color-brand-border);
}

.account-settings-tile--danger {
  background-color: color-mix(
    in srgb,
    var(--ac-color-semantic-overdue) 7%,
    var(--auth-color-surface)
  );
}

.account-settings-tile--danger .account-settings-item-title,
.account-settings-tile--danger > svg {
  color: var(--ac-color-semantic-overdue);
}

.account-settings-tile--danger:hover,
.account-settings-tile--danger:focus-visible {
  background-color: color-mix(
    in srgb,
    var(--ac-color-semantic-overdue) 11%,
    var(--auth-color-surface)
  );
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac-color-semantic-overdue) 20%, transparent);
}

@media (min-width: 640px) {
  .account-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =============================================================================
   Settings form rhythm
   ============================================================================= */
.auth-settings-form {
  display: block;
}

.auth-settings-field {
  margin-bottom: var(--auth-spacing-lg);
}

.auth-settings-field:last-of-type {
  margin-bottom: 0;
}

.auth-settings-field > .label {
  padding-bottom: var(--auth-spacing-xs);
}

.auth-settings-actions {
  margin-top: var(--auth-spacing-lg);
}

/* =============================================================================
   Form Input Styles
   Scoped to .auth-container for higher specificity to override DaisyUI
   ============================================================================= */

/* Placeholder text - high contrast */
.auth-container .input::placeholder,
.auth-card-shadow .input::placeholder {
  color: var(--auth-color-text-placeholder);
  opacity: 0.5;
}

/* Ant Design Input — white background, 1px #d9d9d9 border, 36px tall, 6px radius. */
.auth-container .input.input,
.auth-card-shadow .input.input {
  height: var(--auth-control-height);
  min-height: var(--auth-control-height);
  background-color: var(--auth-color-surface);
  border: 1px solid var(--ac-color-brand-card-border);
  border-radius: var(--auth-radius-control);
  padding: 0 11px;
  font-size: 16px; /* keep >=16px to avoid iOS Safari zoom-on-focus */
  color: var(--auth-color-text-primary);
  box-shadow: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.auth-container .input.input:hover,
.auth-card-shadow .input.input:hover {
  background-color: var(--auth-color-surface);
  border-color: var(--ac-color-brand-primary);
}

.auth-container .input.input:focus,
.auth-container .input.input:focus-visible,
.auth-container .input.input:focus-within,
.auth-card-shadow .input.input:focus,
.auth-card-shadow .input.input:focus-visible,
.auth-card-shadow .input.input:focus-within {
  outline: none;
  outline-offset: 0;
  border-color: var(--ac-color-brand-primary);
  box-shadow: var(--auth-shadow-focus-antd);
  background-color: var(--auth-color-surface);
}

/* Ant Design label — sits above the input, 14px regular. */
.auth-container .label-text,
.auth-card-shadow .label-text {
  color: var(--auth-color-text-primary);
  font-size: var(--ac-font-size-label);
  font-weight: var(--ac-font-weight-regular);
}

.auth-container .label-text-alt,
.auth-card-shadow .label-text-alt {
  color: var(--auth-color-text-secondary);
  font-size: var(--ac-font-size-label);
}

/* =============================================================================
   Button Styles — modeled on antd Button (height 36px, radius 6px, weight 400).
   Width is only forced full-width inside .auth-container (login/signup);
   manage pages compose buttons in flex/grid rows and rely on flex-1.
   ============================================================================= */
.auth-container .btn,
.auth-card-shadow .btn {
  height: var(--auth-control-height);
  min-height: var(--auth-control-height);
  padding: 0 15px;
  border-radius: var(--auth-radius-control);
  font-weight: var(--ac-font-weight-regular);
  font-size: var(--ac-font-size-label);
  letter-spacing: 0;
  box-shadow: none;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}

.auth-container .btn {
  width: 100%;
}

/* Manage subpage submit buttons (e.g. Change Password, Add Email) ship
   from allauth_ui with .w-full. On desktop, size them to content so the
   form reads like a settings page rather than a login CTA. */
@media (min-width: 768px) {
  .auth-card-shadow .btn.w-full {
    width: auto;
    min-width: 9rem;
  }

  .auth-card-shadow .provider-btn.w-full {
    width: 100%;
    min-width: 0;
  }
}

.auth-container .btn-primary,
.auth-card-shadow .btn-primary {
  background-color: var(--ac-color-brand-primary);
  border-color: var(--ac-color-brand-primary);
  color: var(--ac-color-text-on-primary);
}

.auth-container .btn-primary:hover,
.auth-container .btn-primary:focus-visible,
.auth-card-shadow .btn-primary:hover,
.auth-card-shadow .btn-primary:focus-visible {
  background-color: var(--ac-color-brand-primary-hover);
  border-color: var(--ac-color-brand-primary-hover);
  color: var(--ac-color-text-on-primary);
}

.auth-container .btn-primary:focus-visible,
.auth-card-shadow .btn-primary:focus-visible {
  box-shadow: var(--auth-shadow-focus-antd);
}

.auth-container .btn-primary:disabled,
.auth-container .btn-primary[disabled],
.auth-card-shadow .btn-primary:disabled,
.auth-card-shadow .btn-primary[disabled] {
  background-color: var(--ac-color-brand-primary);
  border-color: var(--ac-color-brand-primary);
  opacity: 0.5;
}

/* Antd "default" Button — white bg, 1px gray border, primary on hover. */
.auth-container .btn-outline:not(.btn-error),
.auth-card-shadow .btn-outline:not(.btn-error) {
  background-color: var(--auth-color-surface);
  border-color: var(--ac-color-brand-card-border);
  color: var(--auth-color-text-primary);
}

.auth-container .btn-outline:not(.btn-error):hover,
.auth-container .btn-outline:not(.btn-error):focus-visible,
.auth-card-shadow .btn-outline:not(.btn-error):hover,
.auth-card-shadow .btn-outline:not(.btn-error):focus-visible {
  background-color: var(--auth-color-surface);
  border-color: var(--ac-color-brand-primary);
  color: var(--ac-color-brand-primary);
}

.auth-card-shadow .btn-outline:not(.btn-error):focus-visible,
.auth-container .btn-outline:not(.btn-error):focus-visible {
  box-shadow: var(--auth-shadow-focus-antd);
}

.btn-error {
  background-color: var(--ac-color-semantic-overdue);
  border-color: var(--ac-color-semantic-overdue);
  color: white;
}

.btn-error:hover {
  background-color: var(--ac-color-semantic-overdue-hover, #b91c1c);
  border-color: var(--ac-color-semantic-overdue-hover, #b91c1c);
}

.btn-error:disabled,
.btn-error[disabled] {
  background-color: var(--ac-color-semantic-overdue);
  border-color: var(--ac-color-semantic-overdue);
  opacity: 0.5;
}

/* =============================================================================
   Link Styles
   ============================================================================= */
.auth-container a.link {
  text-decoration: none;
  color: var(--auth-color-accent);
  transition: color var(--auth-transition-fast);
}

.auth-container a.link:hover {
  color: var(--auth-color-accent-hover);
  text-decoration: none;
}

/* =============================================================================
   Entrance legal footer & sign-up consent
   Subtle legal/support links shown beneath the sign-in / sign-up forms.
   Styled here via semantic classes (rather than utility classes) because the
   compiled allauth_ui CSS that ships these pages does not include the muted
   `text-base-content/60`, faint `border-base-content/10`, or `link-hover`
   utilities the snippets would otherwise rely on. Links stay muted so they
   never compete with the primary CTA; the brand accent and an underline
   appear only on hover/focus for affordance — matching `.auth-header-link`.
   ============================================================================= */
.auth-legal-footer {
  margin-top: var(--auth-spacing-lg);
  padding-top: var(--auth-spacing-md);
  border-top: 1px solid var(--ac-color-brand-border);
  text-align: center;
  font-size: var(--ac-font-size-caption);
  line-height: var(--auth-line-height-tight);
  color: var(--auth-color-text-secondary);
}

.auth-legal-footer-link {
  color: var(--auth-color-text-secondary);
  text-decoration: none;
  transition: color var(--auth-transition-fast);
}

.auth-legal-footer-link:hover,
.auth-legal-footer-link:focus-visible {
  color: var(--auth-color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-legal-footer-sep {
  margin-inline: var(--auth-spacing-xs);
  color: var(--auth-color-text-placeholder);
  opacity: 0.6;
}

.auth-signup-consent {
  margin-top: var(--auth-spacing-md);
  text-align: center;
  font-size: var(--ac-font-size-caption);
  line-height: var(--auth-line-height-relaxed);
  color: var(--auth-color-text-secondary);
}

.auth-signup-consent a {
  color: var(--auth-color-accent);
  text-decoration: none;
  transition: color var(--auth-transition-fast);
}

.auth-signup-consent a:hover,
.auth-signup-consent a:focus-visible {
  color: var(--auth-color-accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =============================================================================
   Alert Styles
   ============================================================================= */
.alert {
  gap: var(--auth-spacing-sm) !important;
}

/* =============================================================================
   Divider Styles
   ============================================================================= */
.auth-divider {
  display: flex;
  align-items: center;
  margin: var(--auth-spacing-lg) 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--auth-color-text-placeholder);
  opacity: 0.3;
}

.auth-divider span {
  padding: 0 var(--auth-spacing-md);
  color: var(--auth-color-text-secondary);
  font-size: 14px;
}

/* =============================================================================
   Social Provider Button Styles
   ============================================================================= */
.provider-btn {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) 1.25rem;
  align-items: center;
  column-gap: var(--auth-spacing-sm);
  justify-content: center;
  font-weight: var(--ac-font-weight-regular);
  font-size: var(--ac-font-size-label);
  height: var(--auth-control-height);
  min-height: var(--auth-control-height);
  padding-inline: var(--auth-spacing-md);
  border-radius: var(--auth-radius-control);
  transition:
    background-color var(--auth-transition-fast),
    border-color var(--auth-transition-fast),
    box-shadow var(--auth-transition-fast);
}

.provider-btn svg {
  grid-column: 1;
  width: 1.125rem;
  height: 1.125rem;
  justify-self: center;
}

.provider-btn-label {
  grid-column: 2;
  min-width: 0;
  justify-self: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Google Sign-in Button - follows Google branding guidelines */
/* Use doubled class for specificity to override DaisyUI without !important */
.provider-btn.provider-google {
  background-color: var(--provider-bg);
  border: 1px solid var(--google-border);
  color: var(--google-text);
}

.provider-btn.provider-google:hover {
  background-color: var(--google-bg-hover);
  border-color: var(--google-border-hover);
  box-shadow: var(--google-shadow-hover);
}

.provider-btn.provider-google:focus {
  outline: none;
  border-color: var(--google-border-focus);
  box-shadow: var(--google-shadow-focus);
}

/* =============================================================================
   Mobile layout
   Make the auth "card" fill the viewport on small screens.
   ============================================================================= */
@media (max-width: 450px) {
  .auth-container.auth-container {
    width: 100% !important;
    min-height: 100vh;
    margin: 0 !important;
    border-radius: 0 !important;

    /* Override template padding (p-10) to reduce scroll on mobile */
    padding: 1.5rem !important;
    padding-top: calc(1.5rem + env(safe-area-inset-top)) !important;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)) !important;
    padding-left: calc(1.5rem + env(safe-area-inset-left)) !important;
    padding-right: calc(1.5rem + env(safe-area-inset-right)) !important;
  }

  @supports (min-height: 100dvh) {
    .auth-container.auth-container {
      min-height: 100dvh;
      padding-left: calc(1.5rem + env(safe-area-inset-left)) !important;
      padding-right: calc(1.5rem + env(safe-area-inset-right)) !important;
    }
  }
}

/* =============================================================================
   Auth Header
   Top header rendered on every auth page via templates/components/_auth_header.html.
   All visual values flow from --auth-* / --ac-* design tokens.
   ============================================================================= */
.auth-header {
  width: 100%;
  background-color: var(--ac-color-bg-surface);
  border-bottom: 1px solid var(--ac-color-brand-border);
}

.auth-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--auth-spacing-md);
  max-width: 80rem;
  margin: 0 auto;
  padding: var(--auth-spacing-md) var(--auth-spacing-lg);
}

.auth-brand-link {
  text-decoration: none;
  color: inherit;
}

.auth-brand {
  font-size: var(--ac-font-size-section-header);
  font-weight: var(--auth-font-weight-semibold);
  color: var(--ac-color-brand-primary);
  letter-spacing: -0.01em;
}

.auth-header-link {
  display: inline-flex;
  align-items: center;
  gap: var(--auth-spacing-xs);
  font-size: var(--ac-font-size-caption);
  color: var(--auth-color-text-secondary);
  text-decoration: none;
  transition: color var(--auth-transition-fast);
}

.auth-header-link:hover,
.auth-header-link:focus-visible {
  color: var(--auth-color-accent);
}

.auth-header-sign-out {
  display: inline-flex;
}

.auth-header-sign-out--desktop {
  display: none;
}

@media (min-width: 900px) {
  .auth-header-sign-out--desktop {
    display: inline-flex;
  }
}

.auth-header-link-icon {
  width: 1rem;
  height: 1rem;
}

/* =============================================================================
   Header layout — back icon + brand on the left, nav in the middle,
   actions on the right.
   ============================================================================= */
.auth-header-brand {
  display: flex;
  align-items: center;
  gap: var(--auth-spacing-sm);
  flex: 0 0 auto;
}

.auth-header-actions {
  display: flex;
  align-items: center;
  gap: var(--auth-spacing-md);
  flex: 0 0 auto;
}

/* Icon-only "Back to app" button — antd ghost icon button. */
.auth-header-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--auth-control-height);
  height: var(--auth-control-height);
  border-radius: var(--auth-radius-control);
  color: var(--auth-color-text-secondary);
  text-decoration: none;
  transition:
    background-color var(--auth-transition-fast),
    color var(--auth-transition-fast);
}

.auth-header-back:hover,
.auth-header-back:focus-visible {
  background-color: var(--auth-color-input-bg);
  color: var(--auth-color-text-primary);
  outline: none;
}

.auth-header-back-icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* =============================================================================
   Manage Nav — shared link list used by both the desktop header and the
   mobile drawer. List orientation is controlled by the parent.
   ============================================================================= */
.manage-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--auth-spacing-xs);
}

.manage-nav-link {
  display: inline-flex;
  align-items: center;
  padding: var(--auth-spacing-xs) var(--auth-spacing-sm);
  border-radius: var(--auth-radius-control);
  color: var(--auth-color-text-secondary);
  font-size: var(--ac-font-size-caption);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--auth-transition-fast),
    color var(--auth-transition-fast);
}

.manage-nav-link:hover,
.manage-nav-link:focus-visible {
  color: var(--auth-color-text-primary);
  background-color: var(--auth-color-input-bg);
}

.manage-nav-link.is-active {
  color: var(--auth-color-accent);
  background-color: var(--ac-color-a11y-focus-ring);
  font-weight: var(--auth-font-weight-semibold);
}

.manage-nav-link--danger {
  color: var(--ac-color-semantic-overdue);
}

.manage-nav-link--danger:hover,
.manage-nav-link--danger:focus-visible {
  color: var(--ac-color-semantic-overdue-hover);
  background-color: var(--auth-color-input-bg);
}

/* Divider — vertical bar in the desktop horizontal nav,
   horizontal rule in the mobile drawer. */
.manage-nav-divider {
  flex: 0 0 auto;
  list-style: none;
  background-color: var(--ac-color-brand-border);
}

.auth-header-nav .manage-nav-divider {
  width: 1px;
  height: 1.25rem;
  align-self: center;
  margin-inline: var(--auth-spacing-xs);
}

.auth-drawer-nav .manage-nav-divider {
  width: 100%;
  height: 1px;
  margin-block: var(--auth-spacing-xxs, 4px);
}

/* =============================================================================
   Desktop header nav — visible only on md+; hidden on mobile in favor of
   the hamburger toggle.
   ============================================================================= */
.auth-header-nav {
  display: none;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

@media (min-width: 900px) {
  .auth-header-nav {
    display: flex;
  }
}

.auth-header-nav .manage-nav-list {
  flex-direction: row;
  flex-wrap: wrap;
  overflow: visible;
}

/* =============================================================================
   Hamburger toggle — visible only on mobile, hides on md+.
   ============================================================================= */
.auth-header-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--auth-control-height);
  height: var(--auth-control-height);
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--auth-radius-control);
  color: var(--auth-color-text-primary);
  cursor: pointer;
  transition:
    background-color var(--auth-transition-fast),
    border-color var(--auth-transition-fast);
}

.auth-header-menu-toggle:hover,
.auth-header-menu-toggle:focus-visible {
  background-color: var(--auth-color-input-bg);
  outline: none;
}

.auth-header-menu-icon {
  width: 1.25rem;
  height: 1.25rem;
}

@media (min-width: 900px) {
  .auth-header-menu-toggle {
    display: none;
  }
}

/* =============================================================================
   Mobile drawer — full-screen slide-in from the right, covering the page.
   Backdrop dims the rest of the viewport.
   ============================================================================= */
.auth-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.auth-drawer[hidden] {
  display: none;
}

.auth-drawer-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(17, 24, 39, 0);
  transition: background-color 0.2s ease-out;
  pointer-events: auto;
}

.auth-drawer.is-open .auth-drawer-backdrop {
  background-color: rgba(17, 24, 39, 0.45);
}

.auth-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(20rem, 88vw);
  background-color: var(--auth-color-surface);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform 0.2s ease-out;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.auth-drawer.is-open .auth-drawer-panel {
  transform: translateX(0);
}

.auth-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--auth-spacing-md) var(--auth-spacing-lg);
  border-bottom: 1px solid var(--ac-color-brand-border);
}

.auth-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--auth-control-height);
  height: var(--auth-control-height);
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--auth-radius-control);
  color: var(--auth-color-text-primary);
  cursor: pointer;
  transition: background-color var(--auth-transition-fast);
}

.auth-drawer-close:hover,
.auth-drawer-close:focus-visible {
  background-color: var(--auth-color-input-bg);
  outline: none;
}

.auth-drawer-close-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.auth-drawer-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--auth-spacing-md);
}

.auth-drawer-nav .manage-nav-list {
  flex-direction: column;
  gap: var(--auth-spacing-xxs, 4px);
}

.auth-drawer-nav .manage-nav-link {
  display: flex;
  padding: var(--auth-spacing-sm) var(--auth-spacing-md);
  font-size: var(--ac-font-size-body);
}

/* Lock body scroll while the drawer is open. */
html.auth-drawer-locked,
html.auth-drawer-locked body {
  overflow: hidden;
}

@media (max-width: 767px) {
  .auth-header-inner {
    padding: var(--auth-spacing-sm) var(--auth-spacing-md);
  }

  /* Manage pages go edge-to-edge on mobile — no rounded corners,
     no card border, no surrounding gray gutter. The header stays. */
  body.bg-base-300 {
    background-color: var(--auth-color-surface);
  }

  .manage-layout {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
  }

  .manage-layout > .auth-card-shadow {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-width: 0 !important;
    box-shadow: none !important;
  }
}
