/* Under Your Keyboard v15
   Cleaned and organized stylesheet
   Sections:
   1. Tokens / Base
   2. Layout / Header
   3. Tabs / Panels
   4. Controls
   5. Results
   6. Presets
   7. Passphrase
   8. Password Checker
   9. Trust / Privacy / Footer
   10. Responsive
*/

/* 1. Tokens / Base */
:root {
    --bg: #f5f1e8;
    --surface: #ffffff;
    --surface-soft: #fbfaf7;
    --surface-muted: #f0ebe1;
    --text: #1f2933;
    --muted: #586777;
    --border: #d9d2c6;
    --primary: #1f6f73;
    --primary-dark: #18585b;
    --primary-soft: #e3f1f1;
    --danger: #a6423a;
    --danger-soft: #f8e9e7;
    --shadow: 0 14px 38px rgba(31, 41, 51, 0.10);
    --shadow-soft: 0 8px 22px rgba(31, 41, 51, 0.07);
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(31, 111, 115, 0.10), transparent 34rem),
        linear-gradient(180deg, #fbf7ef 0%, var(--bg) 42%, #efe8dc 100%);
    color: var(--text);
}

button,
input,
select {
    font-family: inherit;
}

button {
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:disabled {
    background: #d7dde2 !important;
    color: #8a96a3 !important;
    border-color: #c7d0d8 !important;
    cursor: not-allowed;
    transform: none;
}

select,
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 15px;
    background: #ffffff;
    color: var(--text);
}

label select,
label input[type="text"] {
    margin-top: 7px;
}

.hidden {
    display: none !important;
}

/* 2. Layout / Header */
.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 24px 20px 36px;
}

.site-header {
    text-align: center;
    margin: 4px 0 36px;
}

.site-logo {
    width: 155px;
    max-width: 55vw;
    filter: drop-shadow(0 8px 14px rgba(31, 41, 51, 0.12));
}

.site-header h1 {
    font-size: clamp(24px, 3.4vw, 40px);
    color: var(--primary);
    margin: 12px 0 16px;
    line-height: 1.25;
}

.site-header p {
    color: var(--muted);
    margin: 0;
    font-size: 17px;
}

.app-shell,
.card,
.trust-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(217, 210, 198, 0.90);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.app-shell {
    overflow: hidden;
    margin-bottom: 34px;
}

.tab-panel {
    padding: 28px;
}

/* 3. Tabs / Panels */
.desktop-tabs {
    display: flex;
    align-items: end;
    gap: 4px;
    padding: 14px 18px 0;
    background: linear-gradient(180deg, rgba(251, 250, 247, 0.98), rgba(240, 235, 225, 0.72));
    border-bottom: 1px solid var(--border);
}

.mode-tab {
    position: relative;
    top: 1px;
    background: var(--surface-muted);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
}

.mode-tab.active {
    background: #ffffff;
    color: var(--primary-dark);
    border-color: var(--primary);
    box-shadow: 0 -5px 12px rgba(31, 41, 51, 0.04);
}

.mode-tab.utility-tab {
    margin-left: auto;
}

.mobile-mode-picker {
    display: none;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
}

.mobile-mode-picker label {
    display: block;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.mode-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 22px;
}

.mode-kicker {
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.08em;
    margin: 0 0 6px;
}

.mode-intro h2 {
    margin: 0 0 8px;
    font-size: 32px;
    color: var(--primary-dark);
}

.mode-intro p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

/* 4. Controls */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    background: var(--primary-soft);
    border: 1px solid #cde5e6;
    border-radius: 999px;
    padding: 10px 12px 10px 16px;
}

.quantity-control span {
    font-weight: 800;
    color: var(--primary-dark);
}

.stepper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.stepper input {
    width: 50px;
    height: 38px;
    text-align: center;
    border: 1px solid #c9c9c9;
    border-left: none;
    border-right: none;
    font-size: 16px;
    background: #ffffff;
    margin: 0;
}

.stepper-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 0;
    background: #e8ecef;
    color: var(--text);
    border: 1px solid #c9c9c9;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.stepper-btn.minus {
    border-radius: 10px 0 0 10px;
}

.stepper-btn.plus {
    border-radius: 0 10px 10px 0;
}

.custom-controls {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 22px;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
    align-items: stretch;
}

.control-grid:last-child {
    margin-bottom: 0;
}

.custom-controls .control-grid:nth-child(2) {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.control-grid > label,
.mini-card label {
    display: block;
    font-weight: 700;
    color: var(--text);
    min-width: 0;
}

.compact-number {
    display: block !important;
}

.compact-number span {
    display: block;
    margin-bottom: 8px;
}

.control-grid .stepper {
    width: 100%;
}

.control-grid .stepper input {
    flex: 1;
    min-width: 54px;
}

.control-grid .stepper-btn {
    flex: 0 0 38px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
}

/* 5. Results */
.results-area {
    margin-top: 24px;
    background: #f8fbfb;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: 0 10px 24px rgba(20, 45, 45, 0.06);
}

.results-heading {
    margin-bottom: 16px;
}

.results-heading h3 {
    margin: 0 0 6px;
    color: var(--primary-dark);
    font-size: 24px;
}

.password-summary {
    display: inline-block;
    font-weight: 800;
    color: var(--muted);
    background: var(--primary-soft);
    border: 1px solid #cde5e6;
    border-radius: 999px;
    padding: 9px 14px;
    margin: 0 0 16px;
    font-size: 0.95rem;
}

.generate-btn {
    width: 100%;
    margin: 8px 0 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 0;
    background: var(--primary);
    color: #ffffff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 96, 96, 0.18);
}

.generate-btn:hover {
    background: var(--primary-dark);
}

.copy-status {
    min-height: 22px;
    margin: 0 0 10px;
    color: var(--primary-dark);
    font-weight: 800;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.copy-status.show {
    opacity: 1;
}

.light-actions {
    display: flex;
    gap: 18px;
    margin: 14px 0 14px;
    flex-wrap: wrap;
}

.light-actions button {
    background: transparent;
    color: var(--primary);
    border: none;
    padding: 0;
    font-size: 14px;
}

.password-list {
    display: grid;
    gap: 14px;
}

.password-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
    padding: 14px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #dfe7e7;
    box-shadow: 0 4px 12px rgba(25, 55, 55, 0.04);
}

.password-row:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 18px rgba(25, 95, 95, 0.08);
}

.password-value {
    background: #fffdf8;
    border: 1px solid var(--border);
    border-left: 6px solid var(--primary);
    border-radius: 12px;
    padding: 16px;
    font-family: Consolas, Monaco, monospace;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
    word-break: break-all;
    box-shadow: 0 4px 12px rgba(31, 41, 51, 0.05);
}

.password-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.password-actions button,
.copy-one-btn,
.regen-one-btn {
    white-space: nowrap;
}

.copy-one-btn {
    min-width: 72px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

.regen-one-btn {
    min-width: 64px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #eef3f7;
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 800;
}

.regen-one-btn:hover {
    background: #dfe8ef;
}

.strength-bar-wrap {
    margin: 18px 0 8px;
}

.strength-bar {
    width: 100%;
    height: 14px;
    background: #dfe5ea;
    border-radius: 999px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.35s ease;
}

.strength-fill.weak {
    background: #d9534f;
}

.strength-fill.solid {
    background: #f0ad4e;
}

.strength-fill.strong {
    background: #5cb85c;
}

.strength-fill.elite {
    background: #2e8b57;
}

.strength {
    color: var(--primary-dark);
    font-weight: 800;
    margin: 8px 0 4px;
}

.crack-text {
    color: var(--muted);
    font-weight: 800;
    margin: 8px 0 6px;
}

.crack-note,
.details-note {
    font-size: 12px;
    color: #66727f;
    line-height: 1.4;
}

.crack-note {
    margin-top: 10px;
}

/* 6. Presets */
.presets-panel {
    min-height: 420px;
}

.preset-management-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.mini-card {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

.mini-card.wide {
    grid-column: 1 / -1;
}

.mini-card h3 {
    margin: 0 0 14px;
    color: var(--primary-dark);
}

.mini-card .details-note + .details-note {
    margin-top: 8px;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.button-row button {
    background: #e8ecef;
    color: var(--text);
    border: 1px solid #d0d7de;
}

.primary-btn,
#savePresetBtn {
    width: 100%;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-color: var(--primary-dark);
}

#deleteMyPresetBtn {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #e0b6b1;
}

.recovery-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.recovery-actions button {
    background: var(--surface);
    color: var(--primary-dark);
    border: 1px solid var(--primary);
}

#myPresetSelect option[disabled] {
    color: #8a96a3;
}

.duplicate-box {
    background: #fff8e8;
    border: 1px solid #e1c878;
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 12px;
}

.message {
    color: var(--primary);
    font-weight: bold;
    min-height: 20px;
    margin: 12px 0 0;
}

/* 7. Passphrase */
.passphrase-preset-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.phrase-preset-btn {
    background: #e8ecef;
    color: var(--text);
    border: 1px solid #d0d7de;
}

.phrase-preset-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary-dark);
}

.passphrase-info {
    background: #fffdf8;
    border: 1px solid var(--border);
    border-left: 6px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-top: 14px;
}

.passphrase-info p {
    margin: 0 0 6px;
    color: var(--muted);
    line-height: 1.4;
}

.passphrase-info p:first-child {
    color: var(--primary-dark);
    font-weight: 800;
}

.passphrase-info p:last-child {
    margin-bottom: 0;
}

.passphrase-info #passphraseUseText {
    color: var(--text);
    font-weight: 700;
}

/* 8. Password Checker */
.checker-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.checker-card label {
    display: block;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.checker-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

#checkerInput {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

#toggleCheckerVisibility {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #eef3f7;
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
}

.checker-strength-wrap {
    margin-top: 16px;
}

.checker-suggestions {
    margin: 12px 0 0 20px;
    padding: 0;
    color: var(--text);
}

.checker-suggestions li {
    margin: 6px 0;
}

.balanced-note-box {
    margin-top: 14px;
    padding: 14px;
    background: #fffdf8;
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    border-radius: var(--radius-md);
}

/* 9. Trust / Privacy / Footer */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0 24px;
}

.trust-card,
.card {
    padding: 24px;
}

.trust-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fcfc 100%);
    border: 1px solid #dbe7e7;
    box-shadow: 0 8px 18px rgba(20, 45, 45, 0.05);
}

.trust-card h3,
.privacy h2 {
    margin-top: 0;
    color: var(--primary-dark);
}

.trust-card h3 {
    margin-bottom: 10px;
    font-size: 1.08rem;
    font-weight: 800;
}

.trust-card p {
    line-height: 1.55;
}

.privacy.card {
    margin-top: 26px;
}

.site-footer {
    text-align: center;
    color: var(--muted);
    padding-bottom: 20px;
}

/* 10. Responsive */
@media (max-width: 900px) {
    .desktop-tabs {
        display: none;
    }

    .mobile-mode-picker {
        display: block;
    }

    .tab-panel {
        padding: 20px;
    }

    .mode-intro {
        flex-direction: column;
    }

    .quantity-control {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 10px;
        border-radius: var(--radius-md);
    }

    .quantity-control span {
        display: block;
        width: 100%;
    }

    .quantity-control .stepper {
        display: flex;
        width: 100%;
        min-width: 0;
        flex-shrink: 1;
    }

    .quantity-control .stepper input {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }

    .quantity-control .stepper-btn {
        flex: 0 0 44px;
        width: 44px;
    }

    .control-grid,
    .custom-controls .control-grid,
    .custom-controls .control-grid:nth-child(2),
    .preset-management-grid,
    .trust-grid {
        grid-template-columns: 1fr;
    }

    .mini-card.wide {
        grid-column: auto;
    }

    .recovery-actions {
        grid-template-columns: 1fr;
    }

    .button-row {
        flex-direction: column;
    }
}

@media (max-width: 700px) {
    .passphrase-preset-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .results-area {
        padding: 16px;
    }

    .password-row {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .password-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .password-value {
        font-size: 1rem;
    }

    .checker-input-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 18px 14px 28px;
    }

    .site-logo {
        width: 140px;
    }

    .site-header {
        margin-bottom: 24px;
    }

    .site-header h1 {
        font-size: 25px;
    }

    .site-header p {
        font-size: 15px;
    }

    .app-shell,
    .card,
    .trust-card {
        border-radius: 18px;
    }

    .mode-intro h2 {
        font-size: 28px;
    }

    .password-summary {
        width: 100%;
        border-radius: var(--radius-md);
    }
}

@media (max-width: 480px) {
    .quantity-control {
        padding: 12px;
    }

    .quantity-control .stepper-btn {
        flex-basis: 42px;
        width: 42px;
    }
}

/* 11. Trust additions / informational pages */
.site-utility-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.site-utility-nav a {
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(217, 210, 198, 0.95);
    border-radius: 999px;
    padding: 8px 13px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.site-utility-nav a:hover {
    background: var(--primary-soft);
}

.trust-details {
    line-height: 1.6;
}

.trust-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.trust-detail-grid > div {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
}

.trust-detail-grid h3 {
    margin: 0 0 8px;
    color: var(--primary-dark);
}

.trust-detail-grid p {
    margin: 0;
}

.info-page {
    max-width: 900px;
}

.compact-header {
    margin-bottom: 24px;
}

.info-card {
    line-height: 1.65;
}

.info-card h1 {
    color: var(--primary-dark);
    margin-top: 0;
}

.info-card h2 {
    color: var(--primary-dark);
    margin-top: 26px;
}

.info-card a,
.trust-details a {
    color: var(--primary-dark);
    font-weight: 700;
}

@media (max-width: 700px) {
    .trust-detail-grid {
        grid-template-columns: 1fr;
    }
}

.entropy-help {
    display: inline-block;
    margin-left: 4px;
    color: var(--primary);
    font-weight: 800;
    cursor: help;
}
