/*
 * The sign-in page's look (signin.html), layout A: one panel in the middle of the page. It is a file of its own
 * because the Worker sends a browser without a sign-in nothing of the app, styles.css included. The colours and the
 * key are copied from styles.css; a change to either belongs in both.
 */
:root {
  --bg: #161616;
  --panel: #242424;
  --text: #ffffff;
  --silver: #bdbdbd;
  --field: #2c2c2c;
  --field-edge: #505050;
  --gold: #e2b54e;
  --red: #e5484d;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--gold) 40%, transparent);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

h1 {
  margin: 0;
  line-height: 1.25;
}

.caps {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--silver);
}

input {
  font: inherit;
  color: var(--text);
  min-width: 0;
  width: 100%;
}

/* The calculator's key as mockup A draws it: a raised pill lettered in gold. */
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--field-edge);
  border-radius: 18px;
  background: var(--field);
  color: var(--gold);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.key:hover {
  border-color: var(--silver);
}

.key:disabled {
  opacity: 0.4;
  cursor: default;
}

.signin {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.signin-panel {
  width: min(380px, 100%);
  background: var(--panel);
  border-radius: 12px;
  padding: 26px;
  display: grid;
  gap: 8px;
}

.signin-panel h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}

/* The box is the panel's own, so SHOW sits inside its edge and the edge follows the focus. */
.signin-box {
  display: flex;
  align-items: center;
  height: 44px;
  background: var(--field);
  border: 1px solid var(--field-edge);
  border-radius: 8px;
}

.signin-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.signin-box.bad,
.signin-box.bad:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}

.signin-box input,
.signin-box input:focus {
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  padding: 0 4px 0 12px;
  border-radius: 7px 0 0 7px; /* inside the box's edge, so a password manager's fill colour keeps its rounding */
  font-size: 16px; /* not smaller, or a phone zooms in on focus */
}

.signin-toggle {
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 11px; /* small, beside the .caps lettering it shares */
  cursor: pointer;
  height: 100%;
  padding: 0 12px;
}

.signin-toggle:hover {
  color: var(--text);
}

/* Always there, so the key does not move when a problem shows. */
.signin-problem {
  min-height: 18px;
  color: var(--red);
}

.signin-key {
  width: 100%;
  height: 44px;
  border-radius: 22px;
}
