:root {
    --accent: #6ee7a8;
    --accent-strong: #34d399;
    --bg-card: rgba(18, 24, 22, 0.62);
    --border: rgba(255, 255, 255, 0.12);
    --text: #eef2f0;
    --text-dim: #9fb0a8;
    --danger: #fca5a5;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow-x: hidden;
}

/* Фоновая картинка — приглушённая, чтобы не бросалась в глаза */
.bg {
    position: fixed;
    inset: 0;
    background-image: url("background.jpg");
    background-size: cover;
    background-position: center;
    /* Затемняем и слегка размываем, чтобы фон был ненавязчивым */
    filter: brightness(0.55) saturate(0.85) blur(1px);
    transform: scale(1.05); /* убираем светлые края от blur */
    z-index: -2;
}

/* Если картинки нет — спокойный градиент вместо неё */
.overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(20, 40, 32, 0.25), transparent 60%),
        linear-gradient(180deg, rgba(10, 14, 12, 0.55), rgba(10, 14, 12, 0.78));
    z-index: -1;
}

.card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 34px 32px 30px;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: rise 0.5s ease both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card__header {
    text-align: center;
    margin-bottom: 24px;
}

.card__header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.card__header p {
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-dim);
}

/* Поле с паролем */
.password {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 14px 14px 18px;
    margin-bottom: 14px;
}

.password__text {
    flex: 1;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 18px;
    font-weight: 500;
    word-break: break-all;
    color: var(--text);
    min-height: 24px;
    line-height: 1.3;
    user-select: all;
}

.password__text.placeholder {
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
}

.icon-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.18s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.icon-btn.copied {
    color: var(--accent);
    background: rgba(52, 211, 153, 0.16);
}

/* Индикатор надёжности */
.strength {
    margin-bottom: 24px;
}

.strength__bar {
    height: 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.strength__bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: var(--accent-strong);
    transition: width 0.35s ease, background 0.35s ease;
}

.strength__meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-dim);
}

/* Слайдер длины */
.control {
    margin-bottom: 22px;
}

.control__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.control__head label {
    font-size: 14px;
    font-weight: 500;
}

.length-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 16px;
    color: var(--accent);
    background: rgba(52, 211, 153, 0.12);
    padding: 2px 12px;
    border-radius: 8px;
    min-width: 44px;
    text-align: center;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid #0f1512;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid #0f1512;
    cursor: pointer;
}

/* Чекбоксы */
.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 26px;
}

.option {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

.option:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
}

.option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option__box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    position: relative;
    transition: all 0.18s ease;
}

.option__box::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #0f1512;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.18s ease;
}

.option input:checked + .option__box {
    background: var(--accent);
    border-color: var(--accent);
}

.option input:checked + .option__box::after {
    transform: rotate(45deg) scale(1);
}

.option input:focus-visible + .option__box {
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35);
}

.option__label {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.option__label em {
    font-style: normal;
    font-size: 11.5px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

/* Кнопка генерации */
.generate {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 15px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #07120d;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 8px 24px rgba(52, 211, 153, 0.28);
}

.generate:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 30px rgba(52, 211, 153, 0.4);
}

.generate:active {
    transform: scale(0.98);
}

.generate svg {
    transition: transform 0.4s ease;
}

.generate:hover svg {
    transform: rotate(180deg);
}

.error {
    margin-top: 14px;
    text-align: center;
    font-size: 13.5px;
    color: var(--danger);
    min-height: 18px;
}

@media (max-width: 420px) {
    .card { padding: 28px 22px 24px; }
    .options { grid-template-columns: 1fr; }
}
