/* =============================================================
   PASSWORD STRENGTH CHECKER — STYLESHEET
   Color palette:
     Background  : #f7f9fc
     Accent      : #3b82f6
     Text        : #1f2937
     White cards : #ffffff
   ============================================================= */

/* ----- Reset & Base ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background-color: #f7f9fc;
  color: #1f2937;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ----- Utility ----- */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1f2937;
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: -0.3px;
}

/* =============================================================
   HEADER
   ============================================================= */
.site-header {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 60%, #60a5fa 100%);
  color: #ffffff;
  padding: 56px 24px 52px;
  text-align: center;
}

.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  width: 68px;
  height: 68px;
  margin-bottom: 20px;
  backdrop-filter: blur(4px);
}

.header-icon svg {
  stroke: #ffffff;
}

.site-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.site-subtitle {
  font-size: 1.1rem;
  opacity: 0.88;
  max-width: 480px;
  margin: 0 auto;
}

/* =============================================================
   TOOL SECTION
   ============================================================= */
.tool-section {
  padding: 56px 0 40px;
}

.tool-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  padding: 40px 44px 36px;
}

/* ----- Input label ----- */
.input-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ----- Character counter ----- */
.char-counter {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: #9ca3af;
  transition: color 0.25s ease;
  flex-shrink: 0;
}

.char-counter.warn   { color: #f97316; }
.char-counter.bad    { color: #ef4444; }
.char-counter.good   { color: #16a34a; }

/* ----- Shortcut hint ----- */
.shortcut-hint {
  font-size: 0.73rem;
  color: #c4c9d4;
  margin-top: 6px;
  line-height: 1;
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.7rem;
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  line-height: 1.5;
}

/* ----- Password input wrapper ----- */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input {
  width: 100%;
  padding: 14px 52px 14px 16px;
  font-size: 1.05rem;
  font-family: "Courier New", Courier, monospace;
  color: #1f2937;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: 0.05em;
}

.password-input:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.password-input::placeholder {
  color: #9ca3af;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: normal;
  font-size: 0.95rem;
}

/* ----- Toggle visibility button ----- */
.toggle-visibility {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.toggle-visibility:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.toggle-visibility:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ----- Strength bar ----- */
.strength-bar-container {
  margin-top: 20px;
}

.strength-bar-track {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: #ef4444;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.35s ease;
}

/* ----- Strength label row ----- */
.strength-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.strength-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #6b7280;
  transition: color 0.3s ease;
}

.strength-score {
  font-size: 0.8rem;
  font-weight: 500;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
  position: relative;
  cursor: default;
}

/* Tooltip for strength score */
.strength-score[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  background: #1f2937;
  color: #f9fafb;
  font-size: 0.71rem;
  font-weight: 400;
  line-height: 1.7;
  padding: 7px 11px;
  border-radius: 7px;
  white-space: pre;
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  letter-spacing: 0;
}

.strength-score[data-tooltip]:hover::before {
  content: "";
  position: absolute;
  right: 10px;
  bottom: calc(100% + 2px);
  border: 5px solid transparent;
  border-top-color: #1f2937;
  z-index: 20;
  pointer-events: none;
}

/* Strength level colors applied via JS data attribute */
[data-strength="very-weak"]  .strength-label { color: #ef4444; }
[data-strength="weak"]       .strength-label { color: #f97316; }
[data-strength="moderate"]   .strength-label { color: #d97706; }
[data-strength="strong"]     .strength-label { color: #22c55e; }
[data-strength="very-strong"] .strength-label { color: #16a34a; }

/* ----- Criteria list ----- */
.criteria-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 20px;
}

.criterion {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.83rem;
  color: #9ca3af;
  transition: color 0.25s ease;
}

.criterion[data-met="true"] {
  color: #16a34a;
}

.criterion-dot {
  width: 16px;
  height: 16px;
  border-radius: 0;
  background: transparent;
  flex-shrink: 0;
  font-size: 0.78rem;
  color: #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease;
  line-height: 1;
}

.criterion-dot::before {
  content: "○";
}

.criterion[data-met="true"] .criterion-dot {
  background: transparent;
  transform: none;
  color: #16a34a;
}

.criterion[data-met="true"] .criterion-dot::before {
  content: "✔";
  font-size: 0.85rem;
}

/* ----- Suggestions box ----- */
.suggestions-box {
  margin-top: 24px;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 18px 20px;
  transition: opacity 0.3s ease;
}

.suggestions-box.hidden {
  display: none;
}

.suggestions-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3b82f6;
  margin-bottom: 10px;
}

.suggestions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.4;
}

.suggestion-item::before {
  content: "→";
  color: #3b82f6;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1.4;
}

/* =============================================================
   EXPLANATION SECTION
   ============================================================= */
.info-section {
  padding: 40px 0;
}

.info-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  padding: 40px 44px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.info-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.info-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: #eff6ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-icon svg {
  stroke: #3b82f6;
}

.info-text h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 5px;
}

.info-text p {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.6;
}

/* =============================================================
   SECURITY TIPS SECTION
   ============================================================= */
.tips-section {
  padding: 40px 0 56px;
}

.tips-section-title {
  color: #1f2937;
}

.tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tip-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 24px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tip-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Last tip spans full width when count is odd */
.tip-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 50%;
  margin: 0 auto;
  width: 100%;
}

.tip-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tip-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 5px;
}

.tip-desc {
  font-size: 0.845rem;
  color: #6b7280;
  line-height: 1.55;
}

/* ----- Crack time + entropy meta row ----- */
.strength-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-top: 8px;
}

.strength-meta.hidden {
  display: none;
}

.meta-item {
  font-size: 0.82rem;
  color: #6b7280;
}

.meta-item strong {
  color: #374151;
  font-weight: 600;
}

/* ----- Security reassurance note ----- */
.security-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  font-size: 0.8rem;
  color: #9ca3af;
  line-height: 1.5;
}

.security-note svg {
  flex-shrink: 0;
  stroke: #9ca3af;
  margin-top: 1px;
}

/* ----- Password Generator ----- */
.generator-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #f3f4f6;
}

.generator-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3b82f6;
  margin-bottom: 5px;
}

.generator-desc {
  font-size: 0.82rem;
  color: #6b7280;
  margin-bottom: 12px;
  line-height: 1.5;
}

.generator-desc em {
  font-style: normal;
  font-weight: 600;
  color: #374151;
}

.generator-input-row {
  display: flex;
  gap: 8px;
}

.base-word-input {
  flex: 1;
  padding: 9px 12px;
  font-size: 0.9rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #1f2937;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.base-word-input:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.base-word-input::placeholder {
  color: #9ca3af;
  font-size: 0.85rem;
}

.generate-btn {
  padding: 9px 18px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.generate-btn:hover  { opacity: 0.9; }
.generate-btn:active { transform: scale(0.97); }
.generate-btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

.generator-result {
  margin-top: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 14px 16px;
}

.generator-result.hidden { display: none; }

.generated-password {
  display: block;
  font-family: "Courier New", Courier, monospace;
  font-size: 1.05rem;
  color: #1f2937;
  letter-spacing: 0.05em;
  word-break: break-all;
  margin-bottom: 12px;
  line-height: 1.5;
}

.generator-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.generator-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1.5px solid #3b82f6;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  background: transparent;
  color: #3b82f6;
}

.generator-action-btn:hover {
  background: #3b82f6;
  color: #ffffff;
}

.generator-action-btn:hover svg { stroke: #ffffff; }

.generator-use-btn {
  background: #3b82f6;
  color: #ffffff;
}

.generator-use-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.generator-use-btn svg { stroke: #ffffff; }

.copy-success {
  color: #16a34a;
  border-color: #16a34a;
  background: transparent;
}

/* =============================================================
   HOW IT WORKS SECTION
   ============================================================= */
.how-section {
  padding: 40px 0;
}

.how-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  padding: 40px 44px;
}

.how-intro {
  font-size: 0.93rem;
  color: #4b5563;
  margin-bottom: 18px;
}

.how-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-bottom: 20px;
}

.how-list li {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.6;
  padding-left: 20px;
  position: relative;
}

.how-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #3b82f6;
  font-weight: 700;
}

.how-note {
  font-size: 0.84rem;
  color: #9ca3af;
  font-style: italic;
}

/* =============================================================
   FAQ SECTION
   ============================================================= */
.faq-section {
  padding: 40px 0 56px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 24px 28px;
}

.faq-question {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.faq-answer {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.65;
}

/* =============================================================
   FOOTER
   ============================================================= */
.site-footer {
  background: #1f2937;
  color: #9ca3af;
  text-align: center;
  padding: 22px 24px;
  font-size: 0.87rem;
}

/* =============================================================
   RESPONSIVE — Tablet (≤ 700px)
   ============================================================= */
@media (max-width: 700px) {
  .site-title {
    font-size: 1.75rem;
  }

  .tool-card,
  .info-card {
    padding: 28px 22px 24px;
  }

  .tips-grid {
    grid-template-columns: 1fr;
  }

  .tip-card:last-child:nth-child(odd) {
    grid-column: auto;
    max-width: 100%;
  }

  .criteria-list {
    gap: 8px 12px;
  }
}

/* =============================================================
   RESPONSIVE — Mobile (≤ 480px)
   ============================================================= */
@media (max-width: 480px) {
  .site-header {
    padding: 40px 20px 36px;
  }

  .site-title {
    font-size: 1.5rem;
  }

  .site-subtitle {
    font-size: 0.95rem;
  }

  .header-icon {
    width: 56px;
    height: 56px;
  }

  .tool-section,
  .info-section,
  .tips-section,
  .how-section,
  .faq-section {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .tool-card,
  .info-card,
  .how-card {
    padding: 22px 18px 20px;
  }

  .faq-item {
    padding: 18px 16px;
  }

  .strength-meta {
    flex-direction: column;
    gap: 4px;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .password-input {
    font-size: 0.95rem;
    padding: 12px 48px 12px 14px;
  }

  .info-item {
    flex-direction: column;
    gap: 12px;
  }

  .strength-bar-track {
    height: 6px;
  }
}
