/*
 * PasswordWolf.com — hand-written replacement for Bootstrap 3 + Flat UI.
 * Visual language is carried over from the 2015 site: navy header band,
 * green panels, table-like settings layout, monospace result rows.
 */

:root {
  --navy: #2c3e50;
  --green: #16a085;          /* brand accent: borders, focus rings, the "on" colour */
  --green-solid: #12806a;    /* filled green carrying white text — 4.86:1 */
  --green-solid-hover: #0e6b58;
  --green-text: #117a65;     /* green text on white — 5.26:1 */
  --text: #34495e;
  --muted: #5e6b6b;          /* 5.6:1 on white */
  --border: #dddddd;
  --danger-bg: #f2dede;
  --danger-border: #ebccd1;
  --danger-text: #a94442;
  --meter-weak: #c0392b;
  --meter-fair: #b9770e;
  --meter-strong: #12806a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--green-text);
}

a:hover {
  color: var(--green-solid-hover);
}

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

.container {
  width: 100%;
  max-width: 1170px;
  margin: 0 auto;
  padding: 0 15px;
}

/* --- header band ------------------------------------------------------- */

.titlebox {
  background-color: var(--navy);
  color: #ffffff;
}

.titlebox-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.wolf {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.titles {
  min-width: 0;
}

h1 {
  margin: 0 0 5px;
  font-size: 2.5em;
  line-height: 1.15;
  font-weight: 700;
}

.url {
  margin: 0;
  color: #bdc3c7;
  font-size: 1em;
}

/* --- layout ------------------------------------------------------------ */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

/* --- panels ------------------------------------------------------------ */

.panel {
  border: 1px solid var(--green);
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 10px 15px;
  background-color: var(--green-solid);
  color: #ffffff;
  font-size: 1.05em;
  font-weight: 500;
  border-bottom: 1px solid #bce8f1;
}

.panel-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: #ffffff;
  opacity: 0.9;
}

/* --- settings form ----------------------------------------------------- */

.errors {
  border-radius: 0;
}

.alert-danger {
  margin: 0;
  padding: 10px 15px;
  background-color: var(--danger-bg);
  border-bottom: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.settings-list .setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem;
  align-items: center;
  gap: 10px;
  padding: 5px;
  border-top: 1px solid var(--border);
}

.settings-list .setting:first-child {
  border-top: 0;
}

label {
  cursor: pointer;
}

.charset {
  display: block;
  color: var(--muted);
  font-size: 0.85em;
  word-break: break-all;
}

/* --- strength meter ----------------------------------------------------- */

.setting-strength {
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label value"
    "meter meter";
  row-gap: 6px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.strength-label {
  grid-area: label;
  color: var(--muted);
  font-size: 0.9em;
}

.meter-text {
  grid-area: value;
  font-size: 0.9em;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.meter {
  grid-area: meter;
}

.meter-track {
  height: 8px;
  border-radius: 4px;
  background: #ecf0f1;
  overflow: hidden;
}

.meter-fill {
  width: 0;
  height: 100%;
  border-radius: 4px;
  background: var(--meter-weak);
}

/* Animate only after the first paint, so the initial value does not sweep in
   from zero (which briefly shows the wrong colour and width). */
.setting-strength[data-ready] .meter-fill {
  transition: width 160ms ease-out, background-color 160ms ease-out;
}

.setting-strength[data-level="good"] .meter-fill {
  background: var(--meter-fair);
}

.setting-strength[data-level="strong"] .meter-fill,
.setting-strength[data-level="very-strong"] .meter-fill {
  background: var(--meter-strong);
}

.setting-strength[data-level="none"] .meter-fill {
  background: transparent;
}

.setting-strength[data-level="good"] .meter-text {
  color: var(--meter-fair);
}

.setting-strength[data-level="strong"] .meter-text,
.setting-strength[data-level="very-strong"] .meter-text {
  color: var(--green-text);
}

.setting-strength[data-level="very-weak"] .meter-text,
.setting-strength[data-level="weak"] .meter-text {
  color: var(--meter-weak);
}

@media (prefers-reduced-motion: reduce) {
  .meter-fill {
    transition: none;
  }
}

input[type="number"],
input[type="text"] {
  width: 100%;
  height: 30px;
  padding: 0 5px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  justify-self: center;
  accent-color: var(--green);
  cursor: pointer;
}

/* --- buttons ----------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 11px 15px;
  border: 0;
  border-radius: 4px;
  background-color: var(--green-solid);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease-in-out;
}

.btn:hover {
  background-color: var(--green-solid-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn-block {
  display: block;
  width: 100%;
  border-radius: 0 0 4px 4px;
  border-top: 1px solid var(--border);
}

/* Flat UI's btn-inverse, used by the original submit button. */
.btn-inverse {
  background-color: #34495e;
}

.btn-inverse:hover {
  background-color: #4a6785;
}

/* --- results ----------------------------------------------------------- */

.results-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.results-table td {
  padding: 5px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.results-table tr:first-child td {
  border-top: 0;
}

.linewrap {
  word-break: break-all;
}

/* Bootstrap 3's inline-code look, which is what the old result rows used. */
.linewrap code {
  padding: 2px 4px;
  border-radius: 4px;
  background-color: #f9f2f4;
  color: #c7254e;
  font-family: Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.pw-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pw-row code {
  flex: 1 1 auto;
  min-width: 0;
}

.copy-password {
  flex: 0 0 auto;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
  color: #5e6b6b;
  font: inherit;
  font-size: 0.75em;
  line-height: 1.8;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 100ms ease-in-out, border-color 100ms ease-in-out;
}

.copy-password:hover {
  border-color: var(--green);
  background: #f4fbf9;
  color: var(--green-text);
}

.copy-password.is-copied {
  border-color: var(--green);
  background: var(--green-solid);
  color: #ffffff;
}

.muted {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7em;
}

.notice {
  margin: 0;
  padding: 15px;
  color: var(--muted);
}

/* --- share links -------------------------------------------------------- */

.share {
  margin: 25px 0 0;
}

.share-label {
  margin: 12px 0 4px;
  font-size: 0.95em;
}

.apiurl {
  margin: 0;
  font-size: 0.92em;
  word-break: break-all;
}

/* --- article ----------------------------------------------------------- */

.content {
  max-width: 900px;
  margin-top: 10px;
  line-height: 1.6;
}

.content h3,
.content h4 {
  margin-top: 1.6em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.content h3 {
  font-size: 1.7em;
}

.content h4 {
  font-size: 1.3em;
}

.content ul {
  padding-left: 1.4em;
}

.content code {
  padding: 1px 4px;
  border-radius: 3px;
  background: #f5f7f8;
  font-family: Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.content pre {
  margin: 1em 0;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f7f9fa;
  line-height: 1.5;
}

.content pre code {
  padding: 0;
  background: none;
  font-size: 0.85em;
}

.content li {
  margin-bottom: 0.5em;
}

.api-table {
  width: 100%;
  min-width: 560px;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.95em;
}

.table-scroll {
  margin: 1em 0 1.5em;
  overflow-x: auto;
}

.api-table th,
.api-table td {
  padding: 8px;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.api-table th:first-child,
.api-table td:first-child {
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

.api-table th {
  background: #ecf0f1;
}

.api-table code {
  padding: 1px 4px;
  border-radius: 3px;
  background: #f5f5f5;
}

/* The original page put the share links and the article in the same
   col-md-9 col-md-offset-1 column; keep that indent on wide screens. */
@media (min-width: 768px) {
  .share,
  .content {
    margin-left: 8.3333%;
    max-width: 75%;
  }
}

/* --- small screens ----------------------------------------------------- */
@media (max-width: 767px) {
  body {
    font-size: 14px;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  h1 {
    font-size: 1.5em;
  }

  .titlebox-inner {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .api-table {
    font-size: 0.85em;
  }

  .api-table th,
  .api-table td {
    padding: 5px;
  }

  /* iOS Safari zooms the page when focusing an input below 16px. */
  input[type="number"],
  input[type="text"] {
    font-size: 16px;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
