/*
  Input 03 — Password Input — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is.
*/

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

:root {
  --input-accent: #39ff14;
  --input-fg: oklch(0.145 0 0);
  --input-border: oklch(0.87 0 0);
  --input-border-hover: oklch(0.72 0 0);
  --input-muted: oklch(0.5 0 0);
  --input-weak: oklch(0.58 0.19 20);
  --input-fair: oklch(0.68 0.14 75);
  --input-strong: oklch(0.6 0.14 155);
}

.password-field {
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

.password-field__label {
  display: block;
  margin-bottom: 0.375rem;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--input-fg);
}

.password-field__control-wrap {
  position: relative;
}

.password-field__control {
  display: block;
  width: 100%;
  height: 3rem;
  border-radius: 0.5rem;
  border: 1px solid var(--input-border);
  background-color: #ffffff;
  padding: 0 2.75rem 0 0.875rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--input-fg);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.password-field__control:hover {
  border-color: var(--input-border-hover);
}

.password-field__control:focus-visible {
  border-color: var(--input-fg);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--input-accent) 40%, transparent);
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
  display: flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.375rem;
  background: none;
  color: var(--input-muted);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.password-field__toggle:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--input-fg);
}

.password-field__toggle:focus-visible {
  outline: 2px solid var(--input-accent);
  outline-offset: 1px;
}

.password-field__toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

.password-field__icon-hide {
  display: none;
}

.password-field[data-visible="true"] .password-field__icon-show {
  display: none;
}
.password-field[data-visible="true"] .password-field__icon-hide {
  display: block;
}

.password-field__strength {
  margin-top: 0.625rem;
}

.password-field__bars {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.password-field__bar-track {
  display: flex;
  flex: 1;
  gap: 0.25rem;
}

.password-field__bar {
  height: 0.25rem;
  flex: 1;
  border-radius: 9999px;
  background-color: oklch(0.92 0 0);
  transition: background-color 180ms ease;
}

.password-field__strength-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--input-muted);
}

.password-field__requirements {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.375rem 0.75rem;
  margin: 0.625rem 0 0;
  padding: 0;
  list-style: none;
}

.password-field__requirement {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--input-muted);
}

.password-field__requirement svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  color: var(--input-muted);
}

.password-field__requirement[data-met="true"] svg {
  color: var(--input-strong);
}

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

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
.input03-layout {
  display: flex;
  min-height: 20rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.input03-layout__panel {
  width: 100%;
  max-width: 415px;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
