/* =============================================================
   Password Generator Widget
   Styles the markup produced by src/sites/b2c/pages/pwgen.js.
   Uses shared design tokens (--brand-*, --text-*, --border, ...)
   with Dreamweaver-reference blues as fallbacks, so B2B and B2C
   pick up the correct palette automatically.
   ============================================================= */

.password-generator-card {
    max-width: 760px;
    margin: 0 auto;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border, #C4D0DC);
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(10, 34, 64, 0.08);
    overflow: hidden;

    /* Force full opacity on both halves of the Duotone icons inside the widget.
       Without this, the secondary path is rendered at 40% opacity (FA default)
       and the icons look washed out on the small icon-btn buttons. */
    --fa-primary-opacity: 1;
    --fa-secondary-opacity: 1;
}

/* -------------------------------------------------------------
   Upper section: password display + strength indicator
   ------------------------------------------------------------- */

.password-section {
    padding: 1.75rem 1.75rem 1.25rem;
    background: linear-gradient(180deg, var(--bg-subtle, #F6F9FC) 0%, var(--bg-surface, #FFFFFF) 100%);
}

.password-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border, #C4D0DC);
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.password-display #password-result {
    flex: 1 1 auto;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.35rem;
    line-height: 1.4;
    color: var(--text-primary, #122033);
    letter-spacing: 0.02em;
    word-break: break-all;
    user-select: all;
}

.password-actions {
    display: flex;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border, #C4D0DC);
    border-radius: 8px;
    color: var(--brand-main-color, #0D4E88);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
    background: var(--brand-main-color, #0D4E88);
    border-color: var(--brand-main-color, #0D4E88);
    color: var(--bg-surface, #FFFFFF);
}

.icon-btn:focus-visible {
    outline: 3px solid rgba(13, 78, 136, 0.25);
    outline-offset: 2px;
}

.icon-btn.success {
    background: var(--green, #2D8558);
    border-color: var(--green, #2D8558);
    color: var(--bg-surface, #FFFFFF);
}

.icon-btn .iconfa {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.strength-bar {
    margin-top: 1rem;
    height: 8px;
    background: var(--border, #C4D0DC);
    border-radius: 999px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    background: #e9ecef;
    border-radius: inherit;
    transition: width 0.4s ease, background 0.3s ease;
}

.strength-info {
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.92rem;
    color: var(--text-secondary, #4A5668);
}

.entropy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.65rem;
    background: var(--bg-subtle, #F6F9FC);
    border: 1px solid var(--border, #C4D0DC);
    border-radius: 999px;
    font-weight: 600;
    color: var(--text-primary, #122033);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* -------------------------------------------------------------
   Lower section: length + options + CTA
   ------------------------------------------------------------- */

.config-section {
    padding: 1.5rem 1.75rem 1.75rem;
    border-top: 1px solid var(--border, #C4D0DC);
}

.length-control {
    margin-bottom: 1.5rem;
}

.length-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.length-label {
    font-weight: 700;
    color: var(--text-primary, #122033);
}

.length-value {
    display: inline-block;
    min-width: 48px;
    padding: 0.2rem 0.55rem;
    text-align: center;
    font-weight: 700;
    color: var(--brand-main-color, #0D4E88);
    background: var(--bg-subtle, #F6F9FC);
    border: 1px solid var(--border, #C4D0DC);
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
    cursor: text;
    outline: none;
}

.length-value:focus {
    border-color: var(--brand-main-color, #0D4E88);
    box-shadow: 0 0 0 3px rgba(13, 78, 136, 0.15);
}

/* Range slider */
.length-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border, #C4D0DC);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
    margin: 0;
}

.length-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-main-color, #0D4E88);
    border: 3px solid var(--bg-surface, #FFFFFF);
    box-shadow: 0 2px 6px rgba(10, 34, 64, 0.3);
    cursor: grab;
    transition: transform 0.1s ease;
}

.length-control input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.length-control input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-main-color, #0D4E88);
    border: 3px solid var(--bg-surface, #FFFFFF);
    box-shadow: 0 2px 6px rgba(10, 34, 64, 0.3);
    cursor: grab;
}

.length-control input[type="range"]:focus-visible {
    outline: 3px solid rgba(13, 78, 136, 0.25);
    outline-offset: 2px;
}

.length-control input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Options grid: 2 columns desktop, 1 column mobile */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 599px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

.option-group {
    background: var(--bg-subtle, #F6F9FC);
    border: 1px solid var(--border, #C4D0DC);
    border-radius: 10px;
    padding: 0.9rem 1rem 0.6rem;
}

.option-group-title {
    font-weight: 700;
    color: var(--text-primary, #122033);
    margin-bottom: 0.65rem;
    font-size: 0.95rem;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.3rem 0;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.option-item .option-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--brand-main-color, #0D4E88);
    cursor: pointer;
    flex: 0 0 auto;
}

.option-item .option-checkbox:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.option-label {
    font-size: 0.92rem;
    color: var(--text-primary, #122033);
    line-height: 1.4;
}

.option-label small {
    display: inline-block;
    margin-left: 0.35rem;
    color: var(--text-muted, #6F7D91);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.82em;
    white-space: nowrap;
}

/* CTA button: rely on Bootstrap .btn .btn-primary .btn-lg,
   just tune width + letter-spacing */
.btn-cta {
    min-width: 220px;
    letter-spacing: 0.02em;
}
