/* ============================================================
   passwd.se  —  modernerad CSS, ersätter Bootstrap + landing-page.css
   ============================================================ */

:root {
    --bg:           #0e151c;
    --ink:          #ffffff;
    --ink-soft:     rgba(255, 255, 255, 0.78);
    --ink-mute:     rgba(255, 255, 255, 0.55);
    --line:         rgba(255, 255, 255, 0.18);
    --pill:         rgba(255, 255, 255, 0.10);
    --pill-hover:   rgba(255, 255, 255, 0.16);
    --pill-active:  #ffffff;
    --pill-active-ink: #14202a;
    --accent:       #6cdcb6;     /* mint, sticker mot bakgrunden */
    --accent-soft:  #b6e8d6;
    --warn:         #ffb96e;

    --serif:  "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --sans:   "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono:   ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* ---------- Bakgrundsbild + overlay ---------- */
/* Byt mellan bakgrunderna genom att kommentera ut den ena: */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background-image: url('../img/bg-abstract.svg');
    /* background-image: url('../img/bg-keyboard.svg'); */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0e151c;
}
.bg-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(14, 21, 28, 0.35) 0%,
            rgba(14, 21, 28, 0.5) 50%,
            rgba(14, 21, 28, 0.7) 100%);
}

/* ---------- Sidans skelett ---------- */
.page {
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 920px;
    margin: 0 auto;
    padding: clamp(1.25rem, 3vh, 2rem) clamp(1.25rem, 4vw, 2.5rem) 2rem;
    display: flex;
    flex-direction: column;
}

/* ---------- Header / logga ---------- */
.hero {
    display: flex;
    align-items: center;
    margin-bottom: clamp(2rem, 5vh, 4rem);
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: var(--ink);
    transition: opacity 0.2s ease;
}
.logo:hover { opacity: 0.85; }

.logo-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #14202a;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.125rem;
    font-variation-settings: "opsz" 36, "SOFT" 100;
}

.logo-name {
    font-family: var(--serif);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    font-variation-settings: "opsz" 24;
}
.logo-dot { color: var(--accent); }

/* ---------- Innehållsområdet (centrerat block) ---------- */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 0;
}

/* ---------- Lösenordsblocket ---------- */
.h-passwords {
    font-family: var(--serif);
    font-weight: 350;
    font-size: clamp(1.875rem, 5.5vw, 3.5rem);
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin: 0 0 1.5rem;
    color: var(--ink);
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
    font-variation-settings: "opsz" 60, "SOFT" 30;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.h-passwords .pw {
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding: 0.125rem 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    user-select: all;
    position: relative;
}
.h-passwords .pw:hover {
    background: rgba(108, 220, 182, 0.15);
    color: var(--accent-soft);
}
.h-passwords .pw:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    background: rgba(108, 220, 182, 0.15);
}
.h-passwords .pw.copied {
    background: rgba(108, 220, 182, 0.32);
    color: var(--accent);
}

/* Subtil kopia-ikon som dyker upp vid hover */
.h-passwords .pw::after {
    content: "";
    display: inline-block;
    width: 0.55em;
    height: 0.55em;
    margin-left: 0.35em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236cdcb6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><rect x='9' y='9' width='13' height='13' rx='2'/><path d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.h-passwords .pw:hover::after,
.h-passwords .pw:focus-visible::after {
    opacity: 0.7;
}
@media (hover: none) {
    .h-passwords .pw::after { opacity: 0.4; }
}

/* "Svårt" — något mindre eftersom orden är längre */
.h-hard .pw {
    font-size: 0.7em;
}

/* ---------- Lead-text (subrubrik) ---------- */
.lead {
    font-family: var(--sans);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    color: var(--ink-soft);
    margin: 0 0 2rem;
    max-width: 32ch;
    text-wrap: balance;
}
.lead em {
    font-style: italic;
    font-family: var(--serif);
    color: var(--accent-soft);
    font-weight: 400;
    font-variation-settings: "opsz" 24, "SOFT" 100;
}

/* ---------- Entropimätare ---------- */
.entropy {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.875rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
}
.ent-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-mute);
}
.ent-bar {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    overflow: hidden;
    display: inline-block;
}
.ent-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--warn);
    transition: width 0.4s ease;
}
.entropy[data-bits="61"] .ent-fill,
.entropy[data-bits="60"] .ent-fill { background: var(--accent); }
.entropy[data-bits="27"] .ent-fill { background: var(--warn); }
.ent-val { color: var(--ink); font-weight: 500; }

/* ---------- Svårighetsväljaren (pillar) ---------- */
.levels {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem auto 1.5rem;
    flex-wrap: wrap;
}
.lvl {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--pill);
    color: var(--ink);
    text-decoration: none;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease;
    min-width: 110px;
    text-align: center;
}
.lvl:hover {
    background: var(--pill-hover);
    transform: translateY(-1px);
}
.lvl.is-active {
    background: var(--pill-active);
    color: var(--pill-active-ink);
    border-color: var(--pill-active);
}

/* ---------- Footer ---------- */
.foot {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    color: var(--ink-mute);
    font-size: 0.8125rem;
}
.foot-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.625rem;
}
.foot-nav a {
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.2s ease;
}
.foot-nav a:hover { color: var(--ink); }
.foot-copy {
    margin: 0;
    font-size: 0.75rem;
    color: var(--ink-mute);
}

/* ---------- Info-sidor (Om / Tips) ---------- */
.h-info {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 1.5rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    font-variation-settings: "opsz" 48, "SOFT" 50;
}

.prose {
    max-width: 56ch;
    margin: 0 auto;
    text-align: left;
    color: var(--ink-soft);
    font-size: 1.0625rem;
    line-height: 1.7;
}
.prose p { margin: 0 0 1rem; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose code {
    font-family: var(--mono);
    font-size: 0.875em;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    color: var(--accent-soft);
}
.prose-sub {
    margin-top: 1.5rem !important;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--ink-mute);
    font-size: 0.9375rem;
}

.cta {
    margin-top: 2rem;
    text-align: center;
}
.cta-btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    background: var(--accent);
    color: #14202a;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 500;
    transition: transform 0.15s ease, background 0.2s ease;
}
.cta-btn:hover {
    transform: translateY(-1px);
    background: var(--accent-soft);
}

/* ---------- Tabell på tips-sidan ---------- */
.entropy-table-wrap {
    max-width: 56ch;
    margin: 2rem auto 0;
    overflow-x: auto;
}
.entropy-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 0.8125rem;
    color: var(--ink-soft);
}
.entropy-table th,
.entropy-table td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
}
.entropy-table th {
    color: var(--ink-mute);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
}
.entropy-table td:first-child {
    color: var(--ink);
    font-weight: 500;
    width: 4em;
}

/* ---------- Mindre skärmar ---------- */
@media (max-width: 480px) {
    .h-passwords {
        font-size: 1.625rem;
        line-height: 1.35;
    }
    .h-hard .pw { font-size: 0.78em; }
    .lvl { padding: 0.625rem 1rem; min-width: 90px; }
    .levels { gap: 0.375rem; }
    .foot-nav { gap: 0.5rem; }
}

/* ---------- Toast (kopierat-feedback) ---------- */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translate(-50%, 1rem);
    padding: 0.625rem 1.125rem;
    background: var(--accent);
    color: #14202a;
    font-family: var(--mono);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.25s ease;
    z-index: 1000;
    max-width: calc(100vw - 2rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
