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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  color: #e2e8f0;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #60a5fa;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ─── Container ──────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ─── Header ─────────────────────────────────────────────────────── */
header {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(96, 165, 250, 0.15);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

header .logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #60a5fa;
}

header .logo:hover {
  text-decoration: none;
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
}

.lang-btn {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.25);
  color: #93c5fd;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.lang-btn:hover, .lang-btn.active {
  background: rgba(96, 165, 250, 0.2);
  border-color: #60a5fa;
  color: #fff;
}

/* ─── Main Content ──────────────────────────────────────────────── */
main {
  flex: 1;
  padding: 2rem 0 3rem;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 0.5rem;
}

.subtitle {
  text-align: center;
  color: #94a3b8;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* ─── Tool Card ──────────────────────────────────────────────────── */
.tool-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 40px rgba(96, 165, 250, 0.05);
  padding: 2rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
}

/* ─── Input Group ────────────────────────────────────────────────── */
.input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.input-group input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid rgba(96, 165, 250, 0.2);
  border-radius: 8px;
  outline: none;
  transition: all 0.2s;
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
}
.input-group input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}
.input-group input::placeholder {
  color: #64748b;
}

.btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}
.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.btn-outline {
  background: transparent;
  color: #60a5fa;
  border: 2px solid rgba(96, 165, 250, 0.4);
}
.btn-outline:hover {
  background: rgba(96, 165, 250, 0.1);
  border-color: #60a5fa;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ─── Strength Meter ─────────────────────────────────────────────── */
.strength-meter {
  margin: 1.5rem 0;
}

.strength-bar-container {
  height: 14px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(96, 165, 250, 0.1);
}

#strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 7px;
  transition: width 0.4s ease, background 0.4s ease;
}

.level-weak {
  background: linear-gradient(90deg, #ef4444, #ef4444) !important;
}
.level-fair {
  background: linear-gradient(90deg, #ef4444, #f97316) !important;
}
.level-strong {
  background: linear-gradient(90deg, #f97316, #eab308) !important;
}
.level-very-strong {
  background: linear-gradient(90deg, #eab308, #22c55e) !important;
}

.strength-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#strength-text {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Criteria List ──────────────────────────────────────────────── */
.criteria-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  list-style: none;
  margin: 1.25rem 0 0;
}

.criteria-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #94a3b8;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.criteria-item::before {
  content: '○';
  font-size: 1.1rem;
  color: #475569;
  transition: all 0.2s;
}

.criteria-item.met {
  color: #4ade80;
}
.criteria-item.met::before {
  content: '✓';
  color: #4ade80;
  font-weight: 700;
}

.criteria-item.unmet {
  color: #f87171;
}
.criteria-item.unmet::before {
  content: '✗';
  color: #f87171;
  font-weight: 700;
}

.criteria-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #e2e8f0;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ─── Generated Password ─────────────────────────────────────────── */
.generated-display {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.generated-display .generated-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4ade80;
  white-space: nowrap;
}

.generated-display .generated-pw {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e2e8f0;
  word-break: break-all;
  flex: 1;
  min-width: 120px;
}

/* ─── Results Panel ──────────────────────────────────────────────── */
#results-panel {
  transition: opacity 0.3s;
}

/* ─── Score display ─────────────────────────────────────────────── */
.score-display {
  text-align: center;
  margin: 1rem 0;
}

.score-number {
  font-size: 3rem;
  font-weight: 800;
}

.crack-time {
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

.crack-time strong {
  color: #f59e0b;
}

/* ─── Footer ─────────────────────────────────────────────────────── */
footer {
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(96, 165, 250, 0.1);
  color: #64748b;
  padding: 2.5rem 0 1.5rem;
  margin-top: auto;
}

footer .container {
  max-width: 960px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.footer-col h4 {
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.35rem;
}

.footer-col a {
  color: #64748b;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: #93c5fd;
  text-decoration: none;
}

.footer-legal {
  border-top: 1px solid rgba(96, 165, 250, 0.1);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.footer-legal .legal-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

/* ─── Legal Pages ────────────────────────────────────────────────── */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.legal-content h1 {
  text-align: left;
  -webkit-text-fill-color: #60a5fa;
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.legal-content .meta {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.legal-content h2 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #e2e8f0;
}

.legal-content p {
  margin-bottom: 1rem;
  color: #94a3b8;
  line-height: 1.7;
}

/* ─── AdSense placeholder ────────────────────────────────────────── */
.ad-placeholder {
  text-align: center;
  margin: 1.5rem 0;
  min-height: 90px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed rgba(96, 165, 250, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #475569;
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }
  .tool-card {
    padding: 1.25rem;
  }
  .input-group {
    flex-direction: column;
  }
  .input-group input {
    min-width: auto;
  }
  .actions {
    flex-direction: column;
  }
  .actions .btn {
    width: 100%;
    text-align: center;
  }
  .criteria-list {
    grid-template-columns: 1fr;
  }
}

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
