/*
 * Globals
 */

/* Links */
a,
a:focus,
a:hover {
  color: #fff;
}

/* Custom default button */
.btn-secondary,
.btn-secondary:hover,
.btn-secondary:focus {
  color: #333;
  text-shadow: none; /* Prevent inheritance from `body` */
  background-color: #fff;
  border: .05rem solid #fff;
}


/*
 * Base structure
 */

html,
body {
  height: 100%;
  background-color: #333;
}

body {
  display: -ms-flexbox;
  display: -webkit-box;
  display: flex;
  -ms-flex-pack: center;
  -webkit-box-pack: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 .05rem .1rem rgba(0, 0, 0, .5);
  box-shadow: inset 0 0 5rem rgba(0, 0, 0, .5);
}

.cover-container {
  /* max-width: 42em; */
}


/*
 * Header
 */
.masthead {
  margin-bottom: 2rem;
}

.masthead-brand {
  margin-bottom: 0;
}

.masthead .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* language menu: plain links (crawlable), opened with <details> */
.lang-menu { position: relative; }
.lang-menu summary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 2rem;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  list-style: none;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: '▾'; font-size: .75rem; opacity: .7; }
.lang-menu summary:hover,
.lang-menu summary:focus-visible { border-color: #ffd54f; }
.lang-menu svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.lang-menu ul {
  position: absolute;
  right: 0;
  z-index: 10;
  min-width: 11rem;
  margin: .4rem 0 0;
  padding: .3rem;
  list-style: none;
  text-align: left;
  background: #2b2b2b;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: .5rem;
  box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .5);
}
.lang-menu li a {
  display: block;
  padding: .4rem .7rem;
  border-radius: .3rem;
  color: #fff;
}
.lang-menu li a:hover,
.lang-menu li a:focus { background: rgba(255, 255, 255, .1); text-decoration: none; }
.lang-menu li a[aria-current] { color: #ffd54f; font-weight: 700; }

/*
 * Cover
 */
.cover {
  padding: 0 1.5rem;
}
.cover .btn-lg {
  padding: .75rem 1.25rem;
  font-weight: 700;
}


/*
 * Footer
 */
.mastfoot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: 1.25rem 0;
  color: rgba(255, 255, 255, .7);
  font-size: .88rem;
}

.italic-credit,
.github-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.italic-logo {
  display: inline-flex;
  padding: .35rem .5rem;
  border-radius: .25rem;
  background: #fff;
}

.italic-credit img {
  display: block;
}


#password,
#source-text {
  width: 100%;
  min-height: 5rem;
  margin: .25rem auto 0;
  text-align: left;
  font-family: monospace;
}

.full-width {
  width: 100%;
}

#length {
  text-align: center;
}
.full-width {
  flex-wrap: wrap;
}

/* password masked without type="password" (no "save password" prompt) */
#password.masked {
  -webkit-text-security: disc;
  text-security: disc;
}

.masthead-brand {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.04em;
}

.masthead-brand:hover { text-decoration: none; }

.mode-switch {
  display: flex;
  gap: .5rem;
  margin: 1.25rem 0;
  padding: .3rem;
  border: 1px solid #555;
  border-radius: .6rem;
  background: #292929;
}

.mode-tab {
  flex: 1;
  padding: .7rem .8rem;
  border: 0;
  border-radius: .4rem;
  background: transparent;
  color: rgba(255,255,255,.72);
  font-weight: 700;
}

.mode-tab.active {
  background: #ffd54f;
  color: #222;
}

.mode-panel {
  padding: 1rem;
  border: 1px solid #555;
  border-radius: .6rem;
  background: rgba(255,255,255,.035);
}

.field-label { display: block; margin: 0 0 .35rem; font-weight: 700; }
.generator-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: .8rem; }
.generator-controls label { margin: 0; }
.generator-controls .form-check { padding: 0; }
.generator-controls select { width: auto; }
.small-note, .privacy-note { margin: .55rem 0 0; color: rgba(255,255,255,.65); font-size: .82rem; }
.result-actions { display: flex; align-items: center; gap: .7rem; margin-top: .7rem; }
.conversion-result { margin-top: 1.1rem; }
.converted-output {
  min-height: 3.2rem;
  padding: .65rem .8rem;
  border: 1px solid #666;
  border-radius: .25rem;
  background: #222;
  color: #fff;
  font-family: monospace;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: none;
}
.reveal-password { margin-top: .5rem; }

@media (max-width: 36em) {
  .mode-switch { flex-direction: row; }
  .generator-controls { align-items: flex-start; }
}

/* Keep the first view focused on the action and its result. */
.step {
  border: 0;
  background: transparent;
  padding: .5rem 0 1rem;
}
.mode-switch { margin-top: .5rem; }
.mode-tab { min-height: 3rem; }
.converted-output {
  display: flex;
  align-items: center;
  min-height: 4rem;
  font-size: 1.25rem;
}
.password-input-group { width: 100%; }
.password-input-group .form-control { flex: 1 1 0; width: 1%; min-width: 0; }
.password-input-group .input-group-prepend { display: flex; margin-right: -1px; }
.password-input-group #generate-password { width: 3.2rem; height: auto; padding: .4rem; }
.password-input-group #generate-password svg { width: 1.25rem; height: 1.25rem; }
.password-input-group #generate-password[aria-busy="true"] svg { animation: password-refresh .5s linear infinite; }
@keyframes password-refresh { to { transform: rotate(360deg); } }
.icon-button { display: inline-flex; align-items: center; justify-content: center; }
.icon-button svg,
#copy-result svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#password-reveal { width: 3rem; padding: .4rem; }
.password-input-group #password { flex: 1 1 0; width: 1%; min-width: 0; min-height: 3.6rem; margin: 0; }
.password-input-group #password-reveal { height: auto; margin: 0; }
#password-reveal[aria-pressed="false"] .icon-eye-open,
#password-reveal[aria-pressed="true"] .icon-eye-closed { display: none; }
#copy-result { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; }
#copy-result.btn-primary { width: 100%; min-height: 3rem; font-weight: 700; }
.result-actions { flex-wrap: wrap; }
#copy-status { width: 100%; }
.converted-output-wrapper { position: relative; }
.converted-output { padding-right: 3rem; }
.copy-converted-button {
  position: absolute;
  top: .45rem;
  right: .45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: .35rem;
  border: 0;
  border-radius: .25rem;
  background: #444;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease-in-out;
}
.copy-converted-button svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.converted-output-wrapper:hover .copy-converted-button,
.copy-converted-button:focus-visible { opacity: 1; pointer-events: auto; }
.copy-converted-button:disabled { display: none; }
@media (hover: none) { .copy-converted-button:not(:disabled) { opacity: 1; pointer-events: auto; } }
#pair-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: .55rem;
  margin: .9rem 0;
  font-size: .88rem;
}
.pair-source,
.pair-target {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: .35rem;
  min-width: 0;
}
.pair-source > label,
.pair-target > label { white-space: nowrap; margin: 0; }
.pair-source .form-control,
.pair-target .form-control { min-width: 0; height: 2.4rem; padding: .25rem .4rem; font-size: .85rem; }
.pair-arrow { display: flex; align-items: center; justify-content: center; width: 1.6rem; height: 2.4rem; color: #ffd54f; }
.pair-arrow svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.key-guide-title { margin: 0 0 .75rem; font-size: 1.15rem; }
@media (max-width: 36em) {
  .step { padding: .25rem 0 .75rem; }
  .mode-switch { gap: .25rem; padding: .2rem; }
  .mode-tab { padding: .55rem .35rem; font-size: .92rem; }
  .mode-panel { padding: .8rem; }
  #pair-controls { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .pair-arrow { display: none; }

}

.mastfoot a { color: #fff; }
.mastfoot a span:last-child { text-decoration: underline; }

.mastfoot { flex-wrap: wrap; }
.mastfoot > * { white-space: nowrap; }
@media (max-width: 36em) { .mastfoot > [aria-hidden="true"] { display: none; } }

/* header in the style of the share images */
body { background: #333 radial-gradient(ellipse at 50% 0, #3d3d3d 0, #2a2a2a 70%) fixed; }
.masthead-brand span { color: #ffd54f; }
.hero {
  max-width: calc(clamp(1.1rem, 4.6vw, 2.5rem) * 20 + 4rem);
  margin: 1.5rem auto 2.5rem;
  text-align: left;
}
.hero .cover-heading {
  margin-bottom: 1.25rem;
  font-size: clamp(2.2rem, 8vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
}
.hero .cover-heading small {
  display: block;
  margin-top: .6rem;
  color: #ffd54f;
  font-size: clamp(1rem, 3.6vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0;
}
.hero .lead {
  max-width: 40rem;
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, .78);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
}
.hero-keys {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hero-keys li {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  min-width: 3.4rem;
  justify-content: center;
  padding: .45rem .8rem;
  border-radius: .5rem;
  background: #555;
  box-shadow: 0 .2rem 0 #222;
  font-size: 1.3rem;
  font-weight: 700;
}
.hero-keys i { color: #ffd54f; font-style: normal; font-size: .85rem; }

/* one column for header, hero and cards */
.masthead .inner {
  width: 100%;
  max-width: calc(clamp(1.1rem, 4.6vw, 2.5rem) * 20 + 7rem);
  margin: 0 auto;
  padding: 0 1.5rem; /* same inset as .cover */
}

/* password card */
.pw-box {
  display: flex;
  align-items: stretch;
  border: 1px solid #666;
  border-radius: .6rem;
  background: #1f1f1f;
  overflow: hidden;
  transition: border-color .15s;
}
.pw-box:focus-within { border-color: #ffd54f; }
.pw-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: .9rem 1rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.25rem;
  letter-spacing: .04em;
  outline: none;
}
.pw-input::placeholder { color: rgba(255, 255, 255, .4); font-size: 1rem; letter-spacing: 0; }
#password.pw-input { min-height: 0; margin: 0; width: auto; }
.pw-actions { display: flex; align-items: center; gap: .3rem; padding: .35rem; }
.pw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  height: 2.6rem;
  min-width: 2.6rem;
  padding: 0 .6rem;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}
.pw-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.pw-btn:active { transform: scale(.95); }
.pw-btn:focus-visible { outline: 2px solid #ffd54f; outline-offset: 1px; }
.pw-btn svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-btn.pw-copy { padding: 0 1rem; background: #ffd54f; color: #222; font-weight: 700; }
.pw-btn.pw-copy:hover { background: #ffe082; color: #222; }
.pw-btn:disabled { opacity: .4; cursor: default; }
#generate-password[aria-busy="true"] svg { animation: password-refresh .5s linear infinite; }

.pw-meter { height: .3rem; margin: .6rem 0 .35rem; border-radius: 1rem; background: rgba(255, 255, 255, .1); overflow: hidden; }
#strength-bar { display: block; height: 100%; width: 0; border-radius: inherit; background: #888; transition: width .3s, background .3s; }
#strength-bar[data-level="0"] { background: #ef5350; }
#strength-bar[data-level="1"] { background: #ffa726; }
#strength-bar[data-level="2"] { background: #ffd54f; }
#strength-bar[data-level="3"] { background: #66bb6a; }
.pw-strength { min-height: 1.2rem; margin: 0; color: rgba(255, 255, 255, .7); font-size: .85rem; }

/* generator options */
#generator-options { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .1); }
.opt-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: .6rem; }
.opt-label { margin-right: .3rem; color: rgba(255, 255, 255, .75); font-size: .88rem; font-weight: 600; }
.length-pills { display: flex; flex-wrap: wrap; gap: .3rem; }
.length-pills button,
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0 .8rem;
  border: 1px solid #5a5a5a;
  border-radius: 2rem;
  background: transparent;
  color: rgba(255, 255, 255, .85);
  font-size: .88rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.length-pills button { min-width: 2.8rem; justify-content: center; font-variant-numeric: tabular-nums; }
.length-pills button:hover,
.chip span:hover { border-color: #999; }
.length-pills button[aria-checked="true"] { border-color: #ffd54f; background: #ffd54f; color: #222; font-weight: 700; }
.length-pills button:focus-visible,
.chip input:focus-visible + span { outline: 2px solid #ffd54f; outline-offset: 2px; }
.chip { position: relative; margin: 0; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span::before { content: ''; flex-shrink: 0; width: .9rem; height: .9rem; margin-right: .45rem; border: 1.5px solid currentColor; border-radius: .25rem; opacity: .6; }
.chip input:checked + span { border-color: #ffd54f; background: rgba(255, 213, 79, .12); color: #fff; }
.chip input:checked + span::before { border-color: #ffd54f; background: #ffd54f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23222' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; opacity: 1; }
.alphabet { margin-top: .2rem; color: rgba(255, 255, 255, .65); font-size: .82rem; }
.alphabet summary { cursor: pointer; }
.alphabet code { display: block; margin-top: .4rem; padding: .5rem .65rem; border-radius: .4rem; background: #1f1f1f; color: #ffd54f; word-break: break-all; font-size: .85rem; }
#copy-status { min-height: 1rem; }
@media (max-width: 36em) {
  .pw-box { flex-wrap: wrap; }
  .pw-input { flex-basis: 100%; }
  .pw-actions { flex: 1 1 100%; justify-content: flex-end; border-top: 1px solid #333; }
  .pw-input { font-size: 1.05rem; padding: .8rem .7rem; }
}

/* logo: blinking typing caret */
.brand-caret {
  display: inline-block;
  width: .12em;
  height: .95em;
  margin-left: .1em;
  border-radius: 1px;
  background: #ffd54f;
  vertical-align: -.1em;
  animation: brand-caret 1.1s steps(1) infinite;
}
@keyframes brand-caret { 50% { opacity: 0; } }

/* H1 layouts: shuffled by app.js */
.hero-layouts span { display: inline-block; white-space: nowrap; }
.hero-layouts span:not(:last-child)::after { content: '·'; margin: 0 .35em 0 .1em; color: rgba(255, 213, 79, .6); }

.faq-link { color: #ffd54f; text-decoration: underline; white-space: nowrap; }
.faq-link:hover { color: #ffe082; }

@media (prefers-reduced-motion: reduce) {
  .brand-caret { animation: none; }
}
