/* VitaDrop connection pages share the native app's palette and system fonts. */
:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: #FCF8FA; --surface: #FFFFFF; --ink: #10142F;
  --muted: #666779; --accent: #B01954; --border: #ECE5EB;
  --primary: #171B39; --primary-text: #FFFFFF;
  background: var(--background); color: var(--ink);
}
body { margin: 0; padding: 1.5rem; font-size: 1.0625rem; }
main { box-sizing: border-box; max-width: 32rem; margin: 3rem auto; padding: 2rem; line-height: 1.5; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
h1 { font-size: 1.75rem; letter-spacing: -.025em; line-height: 1.2; margin-top: 0; }
h2 { font-size: 1.25rem; }
p { color: var(--muted); }
button, input { box-sizing: border-box; min-height: 52px; font: inherit; width: 100%; padding: .75rem 1rem; margin: .5rem 0; border-radius: 16px; }
input { border: 1px solid var(--border); background: var(--background); color: var(--ink); }
button { cursor: pointer; border: 0; background: var(--primary); color: var(--primary-text); font-weight: 600; }
button:disabled { cursor: wait; opacity: .5; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
#cancel, #switch-account { border: 1px solid var(--border); background: var(--background); color: var(--ink); }
[hidden] { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root { --background: #000000; --surface: #24212D; --ink: #F6F0F7; --muted: #BEB7C9; --accent: #FF92B5; --border: #393342; --primary: #F7CEE0; --primary-text: #251522; }
}
@media (max-width: 420px) { body { padding: 1rem; } main { padding: 1.25rem; margin: 1rem auto; } }

/* The plugin sign-in and access review inherit VitaDrop's native visual language. */
.connection-page {
  --background: #fcf8fa; --surface: #fff; --ink: #171b39;
  --muted: #656477; --border: #e7dfe5; --tint: #f8eaf0;
  min-height: 100svh; box-sizing: border-box; padding: 40px 24px 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--background); line-height: 1.5;
}
.connection-page ::selection { background: #f7cee0; color: #251522; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 650; letter-spacing: -.03em; }
.brand-icon { width: 44px; height: 44px; }
main.connection { width: 100%; max-width: 480px; margin: 32px auto 16px; padding: 40px; border: 0; border-radius: 16px; box-shadow: 0 16px 56px -24px #35203130; }
.steps { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 32px; font-size: .875rem; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--background); }
.steps [aria-current] { color: var(--accent); font-weight: 600; }
.steps [aria-current] span { background: var(--tint); }
.connection h1 { font-size: 2rem; font-weight: 650; line-height: 1.15; letter-spacing: -.035em; margin: 0 0 16px; text-wrap: balance; }
.connection h2 { font-size: 1.0625rem; margin: 24px 0 12px; font-weight: 600; }
.page-heading p { margin: 0; }
.page-heading { margin-bottom: 32px; }
.connection .account-hint { font-size: .9375rem; margin: 0 0 16px; }
.connection button { margin: 0 0 12px; border-radius: 12px; transition: background-color 160ms ease-out; }
.connection button:not(#cancel):not(#switch-account) {
  background: linear-gradient(110deg, #ff725e 0%, #ff9953 52%, #ffc760 100%);
  color: #251522;
}
.connection button:not(#cancel):not(#switch-account):hover:not(:disabled) {
  background: linear-gradient(110deg, #ff826e 0%, #ffa563 52%, #ffd17a 100%);
}
.connection button:not(#cancel):not(#switch-account):active:not(:disabled) {
  background: linear-gradient(110deg, #f36856 0%, #f78b47 52%, #f5b84e 100%);
}
.connection button:disabled { opacity: .6; }
.connection input { border-radius: 12px; caret-color: var(--accent); }
.connection label { display: block; font-size: .9375rem; }
.registration-note { text-align: center; font-size: .875rem; margin: 12px 0 0; }
.account-row { padding: 0 0 8px; }
#account { color: var(--ink); margin: 0; overflow-wrap: anywhere; font-size: .9375rem; font-weight: 600; }
.connection #switch-account { width: auto; min-height: 44px; padding: 8px 0; margin: 0; background: transparent; border: 0; color: var(--accent); font-size: .875rem; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
#permissions { padding-left: 20px; margin: 0; font-size: .9375rem; }
#permissions li { padding-left: 4px; margin: 12px 0; }
#permissions li::marker { color: var(--accent); }
.continue-note { font-size: .875rem; margin: 24px 0 16px; }
.connection #cancel { background: transparent; border: 0; margin: 0; color: var(--muted); }
.connection #cancel:hover, .connection #switch-account:hover { color: var(--ink); background: var(--tint); }
#message { font-size: .875rem; margin: 20px 0 0; padding: 12px 16px; background: var(--tint); color: var(--ink); border-radius: 8px; overflow-wrap: anywhere; }
#message:empty { display: none; }
.page-footer { text-align: center; color: var(--muted); font-size: .875rem; margin-top: 0; padding-top: 8px; }
.page-footer nav { display: flex; justify-content: center; gap: 24px; margin-top: 8px; }
.page-footer a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-underline-offset: 4px; }
.connection-page a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
@media (prefers-color-scheme: dark) {
  .connection-page { --background: #181720; --surface: #24212d; --ink: #f6f0f7; --muted: #beb7c9; --border: #49404e; --tint: #3c2636; }
}
@media (max-width: 520px) {
  .connection-page { padding: 24px 16px 16px; }
  main.connection { padding: 24px; margin-top: 24px; }
  .connection h1 { font-size: 1.75rem; }
  .steps { gap: 24px; margin-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { .connection button { transition: none; } }

/* Completion and recovery share one calm, centered composition. */
.result-page { text-align: center; }
.result-symbol { width: 64px; height: 64px; margin: 0 auto 24px; color: var(--accent); }
.result-symbol svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.result-symbol circle { fill: var(--tint); stroke: none; }
.result-check, .result-warning { display: none; }
[data-state="success"] .result-check { display: block; }
[data-state="error"] .result-warning, [data-state="cancelled"] .result-warning { display: block; }
[data-state="loading"] .result-symbol circle { stroke: currentColor; stroke-dasharray: 32 12; fill: none; }
.result-page h1 { text-wrap: balance; margin-bottom: 8px; }
#result-description { margin: 0; }
.primary-link { display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 52px; padding: 12px 16px; margin-top: 32px; border-radius: 12px; font-weight: 600; text-decoration: none; color: #251522; background: linear-gradient(110deg, #ff725e 0%, #ff9953 52%, #ffc760 100%); }
.primary-link:hover { background: linear-gradient(110deg, #ff826e 0%, #ffa563 52%, #ffd17a 100%); }
.primary-link:active { background: linear-gradient(110deg, #f36856 0%, #f78b47 52%, #f5b84e 100%); }
.result-note { font-size: .875rem; margin: 20px 0 0; }

.result-page[data-state="success"] .result-symbol { color: #168447; }
.result-page[data-state="success"] .result-symbol circle { fill: #e8f6ed; }
@media (prefers-color-scheme: dark) {
  .result-page[data-state="success"] .result-symbol { color: #74d99b; }
  .result-page[data-state="success"] .result-symbol circle { fill: #21382b; }
}

.first-log { display: none; margin-top: 32px; text-align: center; }
[data-state="success"] .first-log { display: block; }
.first-log p { margin: 0 0 12px; font-size: .875rem; }
.first-log blockquote { margin: 0 auto; max-width: 24ch; font-size: 1.25rem; line-height: 1.4; font-weight: 500; letter-spacing: -.015em; text-wrap: balance; color: var(--ink); }
