/* Password Generator visual theme. Shared DB artwebstudio settings can still override
   the base custom properties when the administrator explicitly changes them. */
.dbas-tool--password-generator {
    --dbas-border: #30485a;
    --dbas-bg: #102230;
    --dbas-soft: #1a3445;
    --dbas-text: #e7f0f5;
    --dbas-muted: #b8c6cf;
    --dbas-accent: #5668df;
}
.dbas-tool--password-generator .dbas-rating {
    border-color: #d7dee5;
    background: #f4f6f8;
    color: #111827;
}
.dbas-tool--password-generator .dbas-rating__label,
.dbas-tool--password-generator .dbas-rating__value { color: #111827; }
.dbas-tool--password-generator .dbas-rating__meta,
.dbas-tool--password-generator .dbas-rating__status { color: #667085; }

.dbpg { min-width: 0; }
.dbpg__header { margin-bottom: 18px; }
.dbpg__title { margin: 0 0 8px; font-size: clamp(24px, 3vw, 34px); line-height: 1.15; }
.dbpg__description { margin: 0; color: var(--dbas-muted); }

/* Desktop: compact single-row controls when the parent container is wide enough. */
.dbpg__controls {
    display: grid;
    grid-template-columns: minmax(220px, 1.05fr) max-content minmax(175px, .82fr) 142px;
    grid-template-areas: "length options count generate";
    gap: 10px;
    align-items: end;
    width: 100%;
}
.dbpg__control { min-width: 0; }
.dbpg__control--length { grid-area: length; }
.dbpg__control--count { grid-area: count; }
.dbpg__options {
    grid-area: options;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    min-width: 0;
}
.dbpg__generate { grid-area: generate; width: 100%; white-space: nowrap; }

.dbpg__control-label {
    display: block;
    margin: 0 0 5px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--dbas-muted);
}
.dbpg__length-control,
.dbpg__count-control {
    display: grid;
    grid-template-columns: minmax(95px, 1fr) 68px;
    gap: 8px;
    align-items: center;
    min-width: 0;
}
.dbpg__range,
.dbpg__count-range {
    display: block;
    width: 100%;
    min-width: 0;
    accent-color: var(--dbas-accent);
}
.dbas-tool--password-generator input.dbpg__number[type="number"] {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #7890a1;
    border-radius: 4px;
    background: #102230;
    color: #ffffff;
    text-align: center;
    opacity: 1;
    -moz-appearance: textfield;
    -webkit-appearance: none;
    appearance: none;
}
.dbas-tool--password-generator input.dbpg__number[type="number"]::-webkit-outer-spin-button,
.dbas-tool--password-generator input.dbpg__number[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.dbas-tool--password-generator input.dbpg__number[type="number"]:focus {
    outline: none;
    color: #ffffff;
    background: #102230;
    border-color: var(--dbas-accent);
    box-shadow: 0 0 0 1px var(--dbas-accent);
}


.dbpg__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 40px;
    padding: 6px 8px;
    border: 1px solid #d8dee5;
    border-radius: 9px;
    background: #f4f6f8;
    color: #17212b;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    line-height: 1.15;
    margin-bottom: 0;
}
.dbpg__check input {
    flex: 0 0 auto;
    margin: 0;
    accent-color: var(--dbas-accent);
}
.dbpg__check-text { min-width: 0; }
.dbpg__similar-mark {
    color: #e14b4b;
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}
.dbpg__check--similar,
.dbpg__check--edge { padding-left: 7px; padding-right: 8px; }

.dbpg__strength {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin: 16px 0 4px;
}
.dbpg__strength-track {
    position: relative;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: linear-gradient(90deg, #dc2626 0%, #f97316 28%, #eab308 52%, #84cc16 74%, #16a34a 100%);
}
.dbpg__strength-mask {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background: color-mix(in srgb, var(--dbas-soft) 88%, transparent);
    transition: width .22s ease;
}
.dbpg__strength-marker {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    border: 2px solid var(--dbas-bg);
    border-radius: 50%;
    background: var(--dbas-text);
    box-shadow: 0 1px 5px rgba(0,0,0,.25);
    transform: translate(-50%, -50%);
    transition: left .22s ease;
}
.dbpg__strength-score {
    min-width: 70px;
    text-align: right;
    font-size: 13px;
    color: var(--dbas-muted);
    font-variant-numeric: tabular-nums;
}
.dbpg__message {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 9px;
    background: #fff4f4;
    color: #9f1d1d;
}

/* Results: two columns on desktop, one column on narrow screens. */
.dbpg__results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin-top: 16px;
}
.dbpg__result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 7px;
    min-width: 0;
    padding: 5px;
    border-radius: 7px;
    background: #3a4d5d;
}
.dbpg__output {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 44px;
    overflow: hidden;
    padding: 9px 12px;
    border: 1px solid #31495a;
    border-radius: 7px;
    background: #0c1d29;
    color: #dceaf0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 20px;
    line-height: 1.3;
    white-space: nowrap;
    user-select: text;
}
.dbpg__output:focus-visible {
    outline: 2px solid var(--dbas-accent);
    outline-offset: 1px;
}
.dbpg__char { color: #dceaf0; }
.dbpg__char--letter { color: #c5e1ef; }
.dbpg__char--number { color: #71aeef; }
.dbpg__char--symbol { color: #e78c93; }

.dbpg__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid #cbd7df;
    border-radius: 7px;
    background: #dce6ed;
    color: #213442;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease, opacity .15s ease;
}
.dbpg__copy svg { width: 20px; height: 20px; }
.dbpg__copy:hover { opacity: .88; }
.dbpg__copy:active { transform: translateY(1px); }
.dbpg__copy.is-copied { background: #ecfdf3; color: #15803d; }
.dbpg__privacy { margin: 14px 0 0; color: var(--dbas-muted); font-size: 13px; }
.dbpg__toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 99999;
    transform: translateX(-50%);
    padding: 9px 13px;
    border-radius: 9px;
    background: #111827;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    font-size: 13px;
}

/* Small desktop / notebook: split controls predictably instead of squeezing labels. */
@media (max-width: 1120px) {
    .dbpg__controls {
        grid-template-columns: minmax(0, 1fr) minmax(180px, .75fr) 142px;
        grid-template-areas:
            "length count generate"
            "options options options";
        align-items: end;
        row-gap: 10px;
    }
    .dbpg__options { flex-wrap: wrap; }
}

/* Tablet. */
@media (max-width: 760px) {
    .dbpg__header { margin-bottom: 16px; }
    .dbpg__controls {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "length length"
            "options options"
            "count generate";
        gap: 10px;
    }
    .dbpg__options {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }
    .dbpg__check {
        width: 100%;
        min-width: 0;
        white-space: normal;
    }
    .dbpg__results { grid-template-columns: 1fr; }
}

/* Phones. */
@media (max-width: 520px) {
    .dbpg__controls {
        grid-template-columns: 1fr;
        grid-template-areas:
            "length"
            "options"
            "count"
            "generate";
    }
    .dbpg__options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dbpg__length-control,
    .dbpg__count-control { grid-template-columns: minmax(0, 1fr) 68px; }
    .dbpg__generate { min-height: 44px; }
    .dbpg__strength { gap: 8px; }
    .dbpg__strength-score { min-width: 64px; font-size: 12px; }
}

@media (max-width: 350px) {
    .dbpg__options { grid-template-columns: 1fr; }
}
