/* =============================================
   Password Entropy Calculator — Styles
   ============================================= */

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

:root {
  --bg: #0B0F19;
  --bg-card: #131825;
  --bg-input: #0D1220;
  --bg-hover: #1A2035;
  --border: rgba(56, 189, 248, 0.1);
  --border-focus: rgba(56, 189, 248, 0.4);
  --primary: #38BDF8;
  --primary-dim: rgba(56, 189, 248, 0.12);
  --primary-glow: rgba(56, 189, 248, 0.25);
  --green: #22C55E;
  --green-dim: rgba(34, 197, 94, 0.12);
  --yellow: #EAB308;
  --yellow-dim: rgba(234, 179, 8, 0.12);
  --orange: #F97316;
  --orange-dim: rgba(249, 115, 22, 0.12);
  --red: #EF4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --text: #E2E8F0;
  --text-dim: #94A3B8;
  --text-muted: #475569;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-input: #F1F5F9;
  --bg-hover: #E2E8F0;
  --border: rgba(56, 189, 248, 0.15);
  --text: #0F172A;
  --text-dim: #64748B;
  --text-muted: #94A3B8;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
body::before { content: ''; position: fixed; inset: 0; background: radial-gradient(ellipse at top, rgba(56,189,248,0.04), transparent 50%); pointer-events: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Header */
.header { border-bottom: 1px solid var(--border); background: rgba(19,24,37,0.9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
[data-theme="light"] .header { background: rgba(255,255,255,0.9); }
.header-inner { max-width: 720px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.2rem; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); }
.logo h1 { font-size: 1.05rem; font-weight: 700; }
.tagline { font-size: 0.72rem; color: var(--text-dim); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; font-family: var(--font); font-size: 0.8rem; font-weight: 500; border: none; border-radius: 6px; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: #0B0F19; font-weight: 600; }
.btn-primary:hover { box-shadow: 0 4px 12px var(--primary-glow); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--primary); background: var(--primary-dim); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }

/* Main */
.main { max-width: 720px; margin: 0 auto; padding: 24px 20px 60px; }
.section-title { font-size: 0.82rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }

/* Password Input */
.input-section { margin-bottom: 24px; }
.password-field { display: flex; align-items: center; gap: 6px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; transition: all var(--transition); }
.password-field:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-dim); }
.password-input { flex: 1; padding: 10px 12px; font-family: var(--mono); font-size: 1.1rem; color: var(--text); background: transparent; border: none; outline: none; letter-spacing: 0.05em; }
.password-input::placeholder { color: var(--text-muted); letter-spacing: normal; }

/* Strength Bar */
.strength-bar-wrap { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; margin-top: 12px; overflow: hidden; }
[data-theme="light"] .strength-bar-wrap { background: rgba(0,0,0,0.06); }
.strength-bar { height: 100%; width: 0; border-radius: 3px; transition: width 0.4s ease, background 0.4s ease; }
.strength-label-row { display: flex; justify-content: space-between; margin-top: 6px; }
.strength-label { font-size: 0.82rem; font-weight: 600; }
.entropy-bits { font-size: 0.78rem; color: var(--text-dim); font-family: var(--mono); }

/* Options */
.options-section { margin-bottom: 24px; }
.options-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }

.option-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition); text-align: center; }
.option-card:hover { border-color: rgba(56,189,248,0.3); }
.option-card:has(input:checked) { border-color: var(--primary); background: var(--primary-dim); }
.option-card input { display: none; }
.option-icon { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.option-label { font-size: 0.75rem; font-weight: 600; }
.option-count { font-size: 0.68rem; color: var(--text-muted); }

.length-control { display: flex; align-items: center; gap: 16px; }
.length-control label { font-size: 0.82rem; font-weight: 500; color: var(--text-dim); white-space: nowrap; }
.length-value { color: var(--primary); font-weight: 700; font-family: var(--mono); }

input[type="range"] { flex: 1; height: 4px; -webkit-appearance: none; appearance: none; background: rgba(56,189,248,0.2); border-radius: 2px; outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); cursor: pointer; box-shadow: 0 0 8px var(--primary-glow); }

/* Results Grid */
.results-section { margin-bottom: 24px; }
.results-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.result-card { padding: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.result-card .attack-name { font-size: 0.72rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.result-card .attack-speed { font-size: 0.68rem; color: var(--text-muted); }
.result-card .crack-time { font-size: 1.2rem; font-weight: 700; margin-top: 6px; font-family: var(--mono); }
.crack-time.instant { color: var(--red); }
.crack-time.weak { color: var(--orange); }
.crack-time.moderate { color: var(--yellow); }
.crack-time.strong { color: var(--green); }
.crack-time.excellent { color: var(--primary); }

/* Detail Cards */
.detail-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 24px; }
.detail-card { padding: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); text-align: center; }
.detail-label { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-value { font-size: 1rem; font-weight: 700; margin-top: 4px; color: var(--primary); }
.detail-value.mono { font-family: var(--mono); font-size: 0.82rem; }

/* Tips */
.tips-section { margin-bottom: 24px; }
.tips-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tip-card { display: flex; gap: 12px; padding: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: all var(--transition); }
.tip-card:hover { border-color: rgba(56,189,248,0.2); }
.tip-icon { font-size: 1.5rem; flex-shrink: 0; }
.tip-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; }
.tip-text { font-size: 0.78rem; color: var(--text-dim); line-height: 1.5; }

/* Responsive */
@media (max-width: 640px) {
  .options-grid { grid-template-columns: repeat(2, 1fr); }
  .results-grid { grid-template-columns: 1fr; }
  .detail-cards { grid-template-columns: repeat(2, 1fr); }
  .tips-grid { grid-template-columns: 1fr; }
  .password-field { flex-wrap: wrap; }
}
