/* Tokens do PremiumTheme e medidas dos controles da Galeria de Componentes. */
:root {
  color-scheme: light dark;
  --backdrop: #1a3443a6;
  --text-on-photo: #f7fbff;
  --accent: #faa61a;
  --on-accent: #22303b;
  --app: #fafdfd;
  --surface: #fff;
  --subtle: rgb(239 245 245 / 84%);
  --border: rgb(105 128 140 / 15%);
  --border-strong: rgb(105 128 140 / 22%);
  --input-text: #22303b;
  --input-secondary: #425360;
  --input-idle: rgb(255 255 255 / 72%);
  --avatar-identity: #2c8f681a;
  --photo-control: #ffffff32;
  --error: #e65b50;
  --info: #0f6cbd;
  --accent-text: #925900;
  --accent-soft: #faa61a1a;
  --focus: var(--text-on-photo);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --backdrop: #07141dce;
    --avatar-identity: #48be8c21;
    --photo-control: #ffffff25;
    --app: #111a1e;
    --surface: #223139;
    --subtle: rgb(39 52 57 / 65%);
    --border: rgb(208 224 226 / 11%);
    --border-strong: rgb(208 224 226 / 17%);
    --input-text: #e6ecef;
    --input-secondary: #bccbd1;
    --input-idle: rgb(34 49 57 / 85%);
    --error: #ff776e;
    --info: #8cc8ff;
    --accent-text: #ffcb73;
    --accent-soft: #faa61a26;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  background: #152938;
  color: var(--text-on-photo);
  font-size: 1rem;
  line-height: 1.45;
}

body::before, body::after {
  position: fixed;
  content: "";
  pointer-events: none;
}
body::before {
  inset: -32px;
  z-index: -2;
  background: url("./destilaria.jpg") center / cover no-repeat;
  /* WPF's BlurEffect radius is the extent, while the CSS blur value is a Gaussian deviation. */
  filter: blur(14px);
  transition: filter 450ms cubic-bezier(.215,.61,.355,1);
}
body::after {
  inset: 0;
  z-index: -1;
  background: var(--backdrop);
  transition: opacity 450ms linear;
}
body.login-busy::before { filter: blur(4px); }
body.login-busy::after { opacity: .7; }

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: max(61px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
.login { width: min(100%, 340px); }
.identity { text-align: center; margin-bottom: 24px; }
.portrait {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0 auto 16px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 50%;
  background: var(--photo-control);
}
.brand { object-fit: contain; }
.avatar, .initials { width: 84px; height: 84px; border-radius: 50%; }
.avatar { object-fit: cover; }
.initials {
  display: grid;
  place-items: center;
  background: var(--avatar-identity);
  font-size: 2.75rem;
  font-weight: 600;
}
h1 { margin: 0; font-size: 1.75rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
#identity-caption { margin: 6px 0 0; font-size: .8125rem; opacity: .85; overflow-wrap: anywhere; }

#login-form { display: grid; }
.login-fields { display: grid; }
.login-fields > * { grid-area: 1 / 1; }
#login-form.is-busy { visibility: hidden; }
input, button { font: inherit; }
input:is([type="text"], [type="password"]) {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-bottom-color: var(--border-strong);
  border-radius: 4px;
  background: var(--input-idle);
  color: var(--input-text);
  font-size: .875rem;
}
input::placeholder { color: var(--input-secondary); opacity: 1; }
input:is([type="text"], [type="password"]):hover:enabled:not(:focus) { background: color-mix(in srgb, var(--surface) 85%, transparent); }
input:is([type="text"], [type="password"]):focus {
  background: var(--surface);
  border-bottom-color: var(--accent);
  outline: none;
  box-shadow: inset 0 -1px var(--accent);
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 83ms linear, color 83ms linear, scale 83ms ease-out;
}
button:disabled { cursor: default; opacity: .65; }
button:focus-visible, input[type="checkbox"]:focus-visible, h1:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Microsoft Fluent System Icons, MIT. Regular symbols in index.html.
   Catalog 24 px https://fluenticons.co/icon/{person,info,eye,eye-off,dismiss}/
   Catalog 16 px https://fluenticons.co/icon/checkmark/
   Source https://github.com/microsoft/fluentui-system-icons/tree/9bfae3d782fda4c8764f2128cec4d0dda160b283
   License https://github.com/microsoft/fluentui-system-icons/blob/9bfae3d782fda4c8764f2128cec4d0dda160b283/LICENSE */
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
button svg { width: 20px; height: 20px; fill: currentColor; vertical-align: middle; pointer-events: none; }
.quiet {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
}
.quiet:hover:not(:disabled) { background: rgb(255 255 255 / 17%); }
.username-row, .input-actions { position: relative; min-width: 0; }
.username-row { margin-bottom: 12px; }
.input-actions input { padding-right: 42px; }
.first-access {
  position: absolute;
  inset: 0 -48px auto auto;
  width: 40px;
  height: 40px;
  border-radius: 20px;
}
.first-access svg { width: 22px; height: 22px; }
.first-access:hover:enabled, .first-access:focus-visible { background: var(--photo-control); }
.first-access:focus-visible { outline: 1px solid var(--text-on-photo); outline-offset: -1px; }
.input-action {
  position: absolute;
  inset: 4px 4px 4px auto;
  width: 32px;
  padding: 0;
  background: transparent;
  color: var(--input-text);
  border: 0;
  border-radius: 4px;
}
.input-action:hover:not(:disabled) { background: rgb(128 128 128 / 13%); color: var(--input-text); }
.input-action:focus-visible { --focus: var(--input-text); outline-offset: -3px; }
#history-button:hover:enabled { background: transparent; }
.username-row:has(#history-button[hidden]) #username { padding-inline-end: var(--username-no-history-padding, 12px); }
.password-row svg { width: 16px; height: 16px; }
#clear-password { inset-inline-end: 36px; }
.password-row:has(#clear-password:not([hidden])) input { padding-inline-end: 72px; }
#password::-ms-reveal, #password::-ms-clear { display: none; }
/* Premium.PersonDropdown uses the WPF UI ComboBox popup and PremiumAvatar. */
.history {
  --history-surface: #f9f9f9;
  --history-selection: #00000009;
  --history-avatar-neutral: #fff;
  --history-avatar-ring: #0000001a;
  --history-travel: -90px;
  --history-reveal: inset(90px -24px -24px);
  position: absolute;
  inset: calc(100% + 1px) 0 auto;
  z-index: 2;
  max-height: min(292px, var(--history-height, max(64px, calc(50svh - 60px))));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 6px 6px;
  background: var(--history-surface);
  color: var(--input-text);
  border: 1px solid #75757566;
  border-radius: 8px;
  box-shadow: 0 10px 20px rgb(32 32 32 / 13.5%);
  animation: history-enter 167ms cubic-bezier(.05,.64,.28,1);
}
.history[data-above] {
  --history-travel: 90px;
  --history-reveal: inset(-24px -24px 90px);
  inset: auto 0 calc(100% + 1px);
}
@keyframes history-enter {
  from { translate: 0 var(--history-travel); clip-path: var(--history-reveal); }
  to { translate: 0 0; clip-path: inset(-24px); }
}
.history-option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 8px 8px 8px 10px;
  text-align: start;
  font-size: 13px;
  line-height: 18px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 4px;
}
.history-option:hover, .history-option[aria-selected="true"], .history-option:focus-visible {
  background: var(--history-selection);
}
.history-option:focus-visible { outline: 1px solid var(--input-text); outline-offset: -1px; }
.history-avatar {
  --avatar-from: #3774d6;
  --avatar-to: #2f6bd0;
  --avatar-ink: #fff;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-block: -3px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(to bottom right, var(--avatar-from), var(--avatar-to));
  color: var(--avatar-ink);
  box-shadow: inset 0 0 0 1px var(--history-avatar-ring);
  font-size: 10px;
  font-weight: 600;
}
.history-avatar[data-palette="1"] { --avatar-from: #25865e; --avatar-to: #1e7f57; }
.history-avatar[data-palette="2"] { --avatar-from: #7a5fdb; --avatar-to: #6b4fd0; }
.history-avatar[data-palette="3"] { --avatar-from: #bf4a8a; --avatar-to: #b23a7c; }
.history-avatar[data-palette="4"] { --avatar-from: #15818f; --avatar-to: #0e7c8a; }
.history-avatar[data-palette="5"] { --avatar-from: #c84d3c; --avatar-to: #c2412f; }
.history-avatar[data-palette="6"] { --avatar-from: #867614; --avatar-to: #7a6a12; }
.history-avatar[data-palette="7"] { --avatar-from: #58687d; --avatar-to: #4b5a6e; }
.history-avatar:is([data-emoji], [data-photo]) { background: var(--history-avatar-neutral); color: var(--input-text); }
.history-avatar[data-emoji] { font-size: 13.68px; font-weight: 400; }
.history-avatar img { width: 100%; height: 100%; object-fit: cover; }
.history-avatar[data-photo] { position: relative; }
.history-avatar[data-photo]::after {
  position: absolute;
  inset: 0;
  border: 1px solid var(--history-avatar-ring);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}
.history-label { display: flex; min-width: 0; }
.history-name, .history-login { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-login { flex: 0 0 auto; max-width: min(150px, calc(100% - 24px)); color: var(--input-secondary); white-space: pre; }
@media (prefers-color-scheme: dark) {
  .history {
    --history-surface: #2c2c2c;
    --history-selection: #ffffff0f;
    --history-avatar-neutral: #333;
    --history-avatar-ring: #ffffff1f;
  }
  .history-avatar { --avatar-from: #2d5185; --avatar-to: #213d66; --avatar-ink: #a9ccf7; }
  .history-avatar[data-palette="1"] { --avatar-from: #24543f; --avatar-to: #1a4130; --avatar-ink: #98e3c0; }
  .history-avatar[data-palette="2"] { --avatar-from: #47367a; --avatar-to: #342760; --avatar-ink: #c6b8f5; }
  .history-avatar[data-palette="3"] { --avatar-from: #6a2f54; --avatar-to: #522341; --avatar-ink: #f4b1d6; }
  .history-avatar[data-palette="4"] { --avatar-from: #1c5660; --avatar-to: #14434b; --avatar-ink: #8ae0e9; }
  .history-avatar[data-palette="5"] { --avatar-from: #6b3030; --avatar-to: #542424; --avatar-ink: #f7afaa; }
  .history-avatar[data-palette="6"] { --avatar-from: #565024; --avatar-to: #433e1a; --avatar-ink: #e6da84; }
  .history-avatar[data-palette="7"] { --avatar-from: #3f4a59; --avatar-to: #2f3844; --avatar-ink: #bfcada; }
}
@media (forced-colors: active) {
  .history-option[aria-selected="true"] { outline: 1px solid Highlight; }
}
.remember {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 8px;
  margin-top: 16px;
  font-size: .75rem;
  cursor: pointer;
}
.check-control { position: relative; display: grid; place-items: center; }
.check-control input {
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid var(--text-on-photo);
  border-radius: 5px;
  background: var(--photo-control);
  cursor: pointer;
}
.check-control input:checked { background: var(--accent); border-color: var(--accent); }
.check-control input:hover:not(:checked) { background: rgb(255 255 255 / 25%); }
.check-control svg { position: absolute; width: 16px; height: 16px; fill: var(--on-accent); pointer-events: none; visibility: hidden; }
.check-control input:checked + svg { visibility: visible; }
@media (forced-colors: active) {
  .check-control input { appearance: auto; }
  .check-control svg { display: none; }
}
.reset { justify-self: center; margin-top: 8px; font-size: .75rem; padding: 6px 12px; }
.reset:hover:enabled { background: transparent; }
.reset:focus-visible { outline: none; font-weight: 600; }
.busy {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  text-align: center;
  font-size: .8125rem;
}
.busy strong { font-size: 1.125rem; }
.progress {
  display: block;
  width: 32px;
  height: 32px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  margin-bottom: 12px;
  animation: progress-spin 1.4s linear infinite;
}
.progress circle { stroke-dasharray: 24 82; animation: progress-dash 1.4s ease-in-out infinite; }
@keyframes progress-spin { to { transform: rotate(1turn); } }
@keyframes progress-dash {
  0%, 100% { stroke-dasharray: 14 82; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 60 82; stroke-dashoffset: -21; }
}
.primary, .secondary {
  width: 100%;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 400;
  font-size: .875rem;
}
.primary { background: var(--accent); color: var(--on-accent); }
#enter { margin-top: 20px; }
.primary:active:enabled, .secondary:active:enabled { scale: .98; }
.secondary { color: inherit; background: rgb(255 255 255 / 15%); border-color: rgb(255 255 255 / 25%); }
.secondary:hover:not(:disabled) { background: rgb(255 255 255 / 22%); }
.feedback {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-inline-start: 3px solid var(--info);
  border-radius: 8px;
  background: var(--photo-control);
  overflow-wrap: anywhere;
  font-size: .875rem;
}
.feedback[data-error="true"] { border-inline-start-color: var(--error); }
.dialog {
  --focus: var(--input-text);
  width: min(calc(100% - 32px), 400px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  color: var(--input-text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 0 30px rgb(32 32 32 / 40%);
  overflow: hidden;
}
@supports (transition-behavior: allow-discrete) {
  .dialog:not([open]), .dialog:not([open])::backdrop {
    opacity: 0;
    transition: opacity 83ms ease-out, display 83ms allow-discrete, overlay 83ms allow-discrete;
  }
}
.dialog::backdrop { background: rgb(0 0 0 / 28%); }
.dialog[open] { display: flex; flex-direction: column; animation: content-enter 167ms cubic-bezier(.215,.61,.355,1); }
.dialog[open]::backdrop { animation: overlay-enter 167ms linear; }
@keyframes content-enter { from { opacity: 0; scale: .98; } }
@keyframes overlay-enter { from { opacity: 0; } }
.dialog h2 { margin: 0; font-weight: 600; }
#message-title { padding: 22px 24px 0; font-size: 1.25rem; }
.message-text { margin: 20px 24px 30px; font-size: .875rem; overflow: auto; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  padding: 10px 14px;
  margin: 0;
  border-top: 1px solid var(--border);
}
.dialog-actions button { min-height: 32px; }
.dialog-actions .secondary { background: var(--surface); border-color: var(--border-strong); color: var(--input-text); }
.dialog-actions .secondary:hover:enabled { background: var(--subtle); }
.help-dialog { width: min(calc(100% - 32px), 760px); height: 650px; background: var(--app); }
.help-dialog[open] { animation-name: help-enter; }
@keyframes help-enter { from { opacity: 0; scale: .96; } }
.help-caption {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 44px;
  padding-inline: 16px;
  background: rgb(255 255 255 / 9%);
  font-size: .75rem;
}
.dialog-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.help-content { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: center; padding: 18px 26px 20px; min-height: 100%; font-size: .875rem; }
#help-title { margin-bottom: 22px; font-size: 1.75rem; line-height: 34px; }
.help-steps ol { list-style: none; counter-reset: help-step; margin: 0; padding: 0; }
.help-steps li { position: relative; counter-increment: help-step; margin-block-end: 20px; padding-inline-start: 28px; }
.help-steps li::before { content: counter(help-step); position: absolute; inset-inline-start: 0; color: var(--accent-text); font-size: 1.125rem; font-weight: 600; }
.help-steps li strong { font-size: .9375rem; font-weight: 600; }
.help-steps li p { margin: 5px 0 0; color: var(--input-secondary); }
.login-example { display: block; margin-top: 10px; padding: 9px 12px; background: var(--accent-soft); border: 1px solid var(--border); border-radius: 7px; font-size: 1.25rem; font-weight: 600; overflow-wrap: anywhere; }
.help-note { margin: 2px 0 0; padding: 12px; border-radius: 8px; background: var(--subtle); color: var(--input-secondary); }
.help-dialog .dialog-actions { padding: 14px 26px; background: var(--subtle); }
.help-dialog .dialog-actions button { width: auto; min-width: 112px; }
.badge-example { margin: 0; display: grid; gap: 10px; justify-items: center; text-align: center; font-size: .75rem; font-weight: 600; }
.badge-example figcaption { color: var(--input-secondary); font-size: .65625rem; font-weight: 400; }
.badge {
  display: block;
  width: min(100%, 280px);
  height: auto;
  fill: #17191a;
  font: bold 12px Arial, sans-serif;
  overflow: visible;
  filter: drop-shadow(0 2px 7px rgb(0 0 0 / 16%));
}
.badge-outline { fill: #f7f7f2; stroke: #d6d7d1; }
.badge-code { fill: rgb(250 166 26 / 10%); stroke: #e49200; stroke-width: 2; }
@media (max-width: 650px) {
  .help-content { grid-template-columns: 1fr; gap: 20px; padding: 16px 20px 20px; }
  .help-steps { display: contents; }
  #help-title { grid-row: 1; margin-bottom: 0; }
  #help-title br { display: none; }
  .badge { width: min(100%, 220px); }
  .help-dialog .dialog-actions { padding: 12px 20px; }
}
@media (max-width: 455px) {
  .username-row { --username-no-history-padding: 42px; }
  #login-form input:is([type="text"], [type="password"]) { font-size: 1rem; }
  .first-access { inset-inline-end: 4px; inset-block-start: 4px; width: 32px; height: 32px; color: var(--input-text); }
  .first-access:hover:not(:disabled) { background: rgb(128 128 128 / 13%); }
  .username-row input { padding-inline-end: 80px; }
  .username-row .input-action { inset-inline-end: 39px; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after, button, .dialog:not([open]), .dialog:not([open])::backdrop { transition: none; }
  .dialog[open], .help-dialog[open], .dialog[open]::backdrop, .progress, .progress circle, .history { animation: none; }
  .primary:active:enabled, .secondary:active:enabled { scale: none; }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
