/* ============================================================
   Password Generator — style.css
   Responsive, accessible, modern design
   ============================================================ */

/* === CSS Custom Properties === */
:root {
  --clr-bg:            #0f172a;
  --clr-surface:       #ffffff;
  --clr-surface-alt:   #f8faff;
  --clr-border:        #e2e8f0;
  --clr-text:          #1e293b;
  --clr-text-muted:    #64748b;
  --clr-primary:       #4361ee;
  --clr-primary-dark:  #3a0ca3;
  --clr-secondary:     #7209b7;
  --clr-success:       #059669;
  --clr-password:      #065f46;
  --clr-weak:          #dc2626;
  --clr-fair:          #d97706;
  --clr-strong:        #059669;
  --clr-vs:            #4361ee;

  --radius:    12px;
  --radius-sm: 7px;
  --shadow:    0 4px 24px rgba(0, 0, 0, 0.14);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --transition: 0.2s ease;
  --font: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  --font-mono: 'Courier New', 'Lucida Console', monospace;
}

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

/* === Base === */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === Container === */
.container {
  max-width: 900px;
  width: 100%;
  margin: 28px auto;
  padding: 36px 32px 24px;
  background: var(--clr-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* === Header === */
header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--clr-border);
  flex-wrap: wrap;
}

#Logo img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-text { flex: 1; }

#LogoText {
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 800;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 4px;
}

.header-sub {
  font-size: 12px;
  color: var(--clr-text-muted);
  letter-spacing: 0.02em;
}

/* === Options Section === */
#sec_options {
  background: var(--clr-surface-alt);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
}

.option-row:last-child { border-bottom: none; }

.option-label {
  flex: 0 0 230px;
  font-weight: 600;
  font-size: 14px;
  color: var(--clr-text);
}

.option-control {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

/* === Length Control === */
.length-control { gap: 12px; }

#pgLengthRange {
  flex: 1;
  min-width: 140px;
  max-width: 280px;
  height: 6px;
  accent-color: var(--clr-primary);
  cursor: pointer;
  border-radius: 3px;
}

#pgLength {
  width: 68px;
  padding: 6px 10px;
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--clr-primary-dark);
  font-family: var(--font);
  transition: border-color var(--transition);
  background: #fff;
}

#pgLength:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.length-display {
  font-size: 13px;
  color: var(--clr-text-muted);
  white-space: nowrap;
}

/* === Custom Checkbox === */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--clr-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.option-example {
  font-size: 13px;
  color: var(--clr-text-muted);
  font-family: var(--font-mono);
}

/* === Buttons === */
#sec_btn {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 26px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-secondary) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(67, 97, 238, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(67, 97, 238, 0.45);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: #f1f5f9;
  color: var(--clr-text);
  border: 1px solid var(--clr-border);
}

.btn-secondary:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btn-copy {
  padding: 7px 18px;
  font-size: 13px;
  background: #f1f5f9;
  color: var(--clr-text);
  border: 1px solid var(--clr-border);
  flex-shrink: 0;
}

.btn-copy:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--clr-strong);
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: 100px;
  padding: 4px 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* === Password Output === */
#sec_password { margin-bottom: 16px; }

.password-output-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.txt_password {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--clr-password);
  background: #f0fdf4;
  transition: border-color var(--transition);
  word-break: break-all;
  cursor: pointer;
}

.txt_password:focus {
  outline: none;
  border-color: var(--clr-success);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* === Strength Indicator === */
.strength-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 6px;
  flex-wrap: wrap;
}

.strength-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--clr-text-muted);
  flex-shrink: 0;
}

.strength-bar-wrap {
  flex: 1;
  min-width: 100px;
  max-width: 240px;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

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

.strength-text {
  font-weight: 700;
  font-size: 14px;
  min-width: 90px;
  transition: color var(--transition);
}

.entropy-text {
  font-size: 12px;
  color: var(--clr-text-muted);
}

/* Strength levels */
.strength-bar-fill.sv  { background: #dc2626; }
.strength-bar-fill.sw  { background: #f97316; }
.strength-bar-fill.sf  { background: #eab308; }
.strength-bar-fill.ss  { background: #22c55e; }
.strength-bar-fill.svs { background: var(--clr-primary); }

.strength-text.sv  { color: #dc2626; }
.strength-text.sw  { color: #f97316; }
.strength-text.sf  { color: #a16207; }
.strength-text.ss  { color: var(--clr-strong); }
.strength-text.svs { color: var(--clr-primary); }

/* === Phonetic Pronunciation === */
#sec_pron {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  flex-wrap: wrap;
  align-items: flex-start;
}

.Phoneticl {
  flex: 0 0 140px;
  font-size: 13px;
  font-weight: 700;
  color: var(--clr-text-muted);
  padding-top: 2px;
}

.Phoneticr {
  flex: 1;
  font-size: 13px;
  color: var(--clr-text-muted);
  line-height: 1.55;
  min-width: 200px;
}

/* === Tooltip === */
.custom-tooltip {
  display: none;
  padding: 4px 12px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 5px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

/* === Ad containers === */
#ADTOP {
  max-width: 728px;
  width: 100%;
  margin: 0 auto 18px;
  text-align: center;
}

#ADCENTER {
  max-width: 728px;
  width: 100%;
  margin: 18px auto;
  text-align: center;
}

/* === FAQ Section === */
#sec_faq {
  background: var(--clr-surface-alt);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
}

#sec_faq h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--clr-primary-dark);
  margin-bottom: 16px;
}

.faq-item {
  border-bottom: 1px solid var(--clr-border);
  padding: 12px 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-item summary {
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--clr-text);
  transition: color var(--transition);
  padding-right: 4px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: '+';
  font-size: 20px;
  font-weight: 700;
  color: var(--clr-primary);
  flex-shrink: 0;
  transition: transform var(--transition);
  line-height: 1;
}

.faq-item[open] summary::before { content: '−'; }

.faq-item summary:hover { color: var(--clr-primary); }

.faq-item p {
  margin-top: 10px;
  font-size: 14px;
  color: var(--clr-text-muted);
  line-height: 1.65;
  padding-left: 28px;
}

.faq-item code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
  color: #9333ea;
  font-family: var(--font-mono);
}

/* === Security Tips === */
#sec_tips {
  padding: 28px;
  border-top: 2px solid var(--clr-border);
  border-bottom: 2px solid var(--clr-border);
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: var(--clr-surface);
}

#sec_tips h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--clr-primary-dark);
  margin-bottom: 12px;
}

.post_intro {
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--clr-text);
}

.tips-list {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tips-list li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--clr-text);
}

.tips-list code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  color: #b91c1c;
  font-family: var(--font-mono);
}

.tips-list a {
  color: var(--clr-primary);
  text-decoration: none;
}

.tips-list a:hover { text-decoration: underline; }

/* === Return to Top === */
#div2top {
  text-align: center;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--clr-primary);
  font-weight: 700;
  font-size: 14px;
  transition: color var(--transition);
  user-select: none;
}

#div2top:hover { color: var(--clr-secondary); text-decoration: underline; }

/* === Footer === */
footer#sec_btm {
  text-align: center;
  padding: 20px 16px;
  color: var(--clr-text-muted);
  font-size: 13px;
  line-height: 2;
  border-top: 1px solid var(--clr-border);
  margin-top: 8px;
}

footer#sec_btm nav {
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

footer#sec_btm a {
  color: var(--clr-primary);
  text-decoration: none;
  font-weight: 500;
}

footer#sec_btm a:hover { text-decoration: underline; }

.sec_blank { clear: both; height: 1px; }

/* === Accessibility: focus ring === */
:focus-visible {
  outline: 3px solid var(--clr-primary);
  outline-offset: 2px;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 800px) {
  .container {
    margin: 0;
    border-radius: 0;
    padding: 24px 18px;
    box-shadow: none;
  }
}

@media (max-width: 600px) {
  body { font-size: 14px; }

  header { gap: 12px; }

  #sec_options { padding: 14px 16px; }

  .option-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 11px 0;
  }

  .option-label { flex: none; font-size: 13px; }

  #pgLengthRange { min-width: 100%; max-width: 100%; }

  .txt_password { min-width: unset; width: 100%; font-size: 14px; }

  .password-output-group { width: 100%; }

  #sec_btn { flex-direction: column; align-items: stretch; }

  .btn-primary { width: 100%; justify-content: center; padding: 14px; font-size: 16px; }

  #sec_btn .btn-secondary { width: 100%; justify-content: center; }

  .strength-bar-wrap { min-width: 100%; max-width: 100%; }

  .strength-section { flex-direction: row; flex-wrap: wrap; gap: 8px; }

  #sec_tips { padding: 18px 14px; }

  #sec_faq { padding: 16px; }

  .Phoneticl { flex: none; }

  .Phoneticr { min-width: 100%; }
}

@media (max-width: 420px) {
  #LogoText { font-size: 18px; }
  .header-sub { font-size: 11px; }
  .secure-badge { display: none; }
}
