﻿html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body.pw-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(72, 103, 255, 0.18), transparent 22%),
        linear-gradient(180deg, #1f2d6b 0%, #102158 100%);
    color: #182033;
}

.pw-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.pw-card {
    width: min(100%, 760px);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 1.6rem;
    box-shadow: 0 28px 80px rgba(10, 24, 74, 0.34);
    padding: 1.6rem;
}

.pw-section + .pw-section {
    padding-top: 0.25rem;
}

.pw-label,
.pw-output-label,
.pw-subtitle {
    font-size: 1.02rem;
    font-weight: 700;
    color: #1f2d6b;
    margin-bottom: 1rem;
}

.pw-mode-group,
.pw-preset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.pw-mode-group {
    padding: 0.35rem;
    background: #f1f3f8;
    border-radius: 0.9rem;
}

.pw-mode-button,
.pw-preset-button {
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    color: #3f4d67;
    font-size: 1.02rem;
    font-weight: 700;
    padding: 0.95rem 0.75rem;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.pw-mode-button.is-active {
    background: #ffffff;
    color: #13214e;
    box-shadow: 0 8px 20px rgba(23, 39, 90, 0.10);
}

.pw-preset-button {
    border: 1px solid #d7ddea;
    background: #f8faff;
    color: #32415d;
}

.pw-preset-button:hover,
.pw-preset-button:focus {
    background: #eef4ff;
    border-color: #9eb7ef;
}

.pw-title {
    font-size: 1.5rem;
    line-height: 1.35;
    margin: 0;
    color: #a55316;
    font-weight: 800;
}

.pw-description {
    margin: 0.55rem 0 0;
    font-size: 0.96rem;
    line-height: 1.6;
    color: #65708a;
}

.pw-divider {
    height: 1px;
    background: #d9dde8;
    margin: 1.35rem 0;
}

.pw-control-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) 88px;
    gap: 1rem;
    align-items: center;
}

.pw-control-label {
    font-size: 1.05rem;
    color: #5c6781;
    font-weight: 700;
}

.pw-range-wrap .form-range {
    margin: 0;
}

.pw-length-wrap {
    display: flex;
    justify-content: flex-end;
}

.pw-length-input {
    width: 88px;
    height: 50px;
    border-radius: 1rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    border-color: #d7ddea;
    color: #13214e;
}

.pw-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1.2rem;
}

.pw-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    min-height: 58px;
    padding: 0.8rem 0.95rem;
    border: 1px solid #dbe0ec;
    border-radius: 0.95rem;
    background: #fbfcff;
}

.pw-toggle-item-wide {
    grid-column: 1 / -1;
}

.pw-toggle-text {
    font-size: 1rem;
    font-weight: 700;
    color: #44506a;
}

.form-switch .form-check-input {
    width: 3rem;
    height: 1.7rem;
    margin: 0;
    cursor: pointer;
}

.pw-output-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    border: 1px solid #d7ddea;
    border-radius: 0.6rem;
    padding: 1rem 1.25rem;
    background: #ffffff;
    color: #13214e;
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-align: center;
    word-break: break-all;
    font-family: "Consolas", "Courier New", monospace;
}

.pw-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.pw-meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: #edf4ff;
    color: #1f4ec9;
    font-size: 0.9rem;
    font-weight: 700;
}

.pw-meta-pill-muted {
    background: #f2f4f8;
    color: #52607b;
}

.pw-status-text {
    margin-top: 0.8rem;
    font-size: 0.95rem;
    color: #66738d;
}

.pw-button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1.2rem;
}

.pw-action-button {
    min-height: 54px;
    border-radius: 0.8rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.pw-action-button.btn-primary {
    background: #1f67d2;
    border-color: #1f67d2;
}

.pw-action-button.btn-outline-primary {
    color: #1f67d2;
    border-color: #1f67d2;
}

.pw-alternative-list {
    display: grid;
    gap: 0.7rem;
}

.pw-alternative-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.9rem;
    align-items: center;
    width: 100%;
    border: 1px solid #dbe0ec;
    border-radius: 0.95rem;
    background: #fbfcff;
    padding: 0.8rem 0.95rem;
    text-align: left;
}

.pw-alternative-item:hover,
.pw-alternative-item:focus {
    border-color: #9eb7ef;
    background: #f5f8ff;
}

.pw-alternative-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    min-height: 32px;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #eaf0fb;
    color: #45618d;
    font-size: 0.85rem;
    font-weight: 700;
}

.pw-alternative-password {
    min-width: 0;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #13214e;
    word-break: break-all;
}

.pw-alternative-action {
    color: #1f67d2;
    font-size: 0.92rem;
    font-weight: 700;
}

.pw-toggle-item.is-hidden {
    display: none;
}

@media (max-width: 767.98px) {
    .pw-shell {
        padding: 1rem;
    }

    .pw-card {
        padding: 1.15rem;
        border-radius: 1.2rem;
    }

    .pw-mode-group,
    .pw-preset-grid,
    .pw-options-grid,
    .pw-button-row {
        grid-template-columns: 1fr;
    }

    .pw-control-row {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .pw-length-wrap {
        justify-content: flex-start;
    }

    .pw-output-box {
        min-height: 84px;
        font-size: 1.05rem;
    }

    .pw-alternative-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}
