:root {
    --navy: #10253f;
    --blue: #1778d4;
    --teal: #2fc4b2;
    --page: #eef3f8;
    --panel: #ffffff;
    --slot: #f8fafc;
    --text: #172435;
    --muted: #687789;
    --border: #d8e1ea;
    --danger: #b42318;
    --success: #147a50;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 24px 14px 44px;
    background: linear-gradient(180deg, #f8fbfd, var(--page));
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.modal-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: .65;
}

.shell {
    width: min(1050px, 100%);
    margin: 0 auto;
}

.hero {
    margin-bottom: 18px;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(24, 46, 72, .14);
}

.hero-image {
    display: block;
    width: 100%;
    height: auto;
}

.account-panel,
.panel {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 18px 42px rgba(24, 46, 72, .11);
}

.account-panel {
    margin-bottom: 18px;
    padding: 22px;
}

.account-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 13px;
    align-items: end;
}

.field {
    min-width: 0;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.customer-input,
.target-input,
.password-input {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: white;
}

.customer-input:focus,
.target-input:focus,
.password-input:focus,
.qr-url-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(47, 196, 178, .13);
}

.load-button,
.save-button {
    height: 44px;
    min-width: 125px;
    padding: 0 22px;
    border: 0;
    border-radius: 10px;
    background: var(--blue);
    color: white;
    font-weight: 800;
}

.redirect-list {
    display: grid;
    gap: 12px;
    padding: 18px 20px 22px;
    background: #f3f6f9;
}

.redirect-row {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--slot);
    box-shadow: 0 3px 10px rgba(24, 46, 72, .055);
}

.slot-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}

.slot-number-button {
    display: inline-grid;
    min-width: 48px;
    height: 42px;
    padding: 0 12px;
    place-items: center;
    border: 1px solid #b9d6e9;
    border-radius: 11px;
    background: #edf6fb;
    color: #1c5d87;
    font-family: Consolas, monospace;
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 5px 11px rgba(20, 72, 110, .18);
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        background-color .16s ease;
}

.slot-number-button:hover {
    transform: translateY(-2px);
    background: #dfeff8;
    box-shadow: 0 8px 16px rgba(20, 72, 110, .24);
}

.slot-number-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 7px rgba(20, 72, 110, .18);
}

.slot-number-button:focus-visible {
    outline: 3px solid rgba(47, 196, 178, .35);
    outline-offset: 2px;
}

.click-count {
    color: #12665c;
    font-size: .82rem;
    font-weight: 850;
    white-space: nowrap;
}


.test-button {
    height: 34px;
    min-width: 68px;
    padding: 0 14px;
    border: 1px solid #c8dbea;
    border-radius: 9px;
    background: #edf4fb;
    color: #175789;
    font-weight: 800;
    box-shadow: 0 4px 9px rgba(23, 87, 137, .16);
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        background-color .16s ease;
}

.test-button:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #deedf8;
    box-shadow: 0 7px 14px rgba(23, 87, 137, .22);
}

.test-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(23, 87, 137, .16);
}

.save-area {
    padding: 23px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

.password-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 13px;
    align-items: end;
}

.status {
    min-height: 22px;
    margin-top: 13px;
    font-size: .92rem;
    font-weight: 750;
}

.status.success {
    color: var(--success);
}

.status.error {
    color: var(--danger);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    padding: 18px;
    place-items: center;
    background: rgba(7, 20, 35, .72);
    backdrop-filter: blur(5px);
}

.modal-card {
    position: relative;
    width: min(480px, 100%);
    padding: 28px;
    border-radius: 20px;
    background: white;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #eef3f7;
    color: var(--navy);
    font-size: 1.7rem;
    line-height: 1;
}

.modal-title {
    margin: 0 44px 20px 0;
    color: var(--navy);
    font-size: 1.35rem;
}

.qr-code {
    display: grid;
    min-height: 280px;
    padding: 14px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
}

.qr-code img,
.qr-code canvas {
    display: block;
    max-width: 100%;
    height: auto !important;
}

.qr-url-row {
    margin-top: 18px;
}

.qr-url-label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.qr-copy-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px;
}

.qr-url-input {
    min-width: 0;
    height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: #f8fafc;
    font-family: Consolas, monospace;
    font-size: .78rem;
}

.copy-button {
    height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 9px;
    background: var(--blue);
    color: white;
    font-weight: 800;
}

.copy-status {
    min-height: 20px;
    margin-top: 8px;
    color: var(--success);
    font-size: .82rem;
    font-weight: 750;
}

[hidden] {
    display: none !important;
}

@media (max-width: 800px) {
    .account-form,
    .password-grid {
        grid-template-columns: 1fr;
    }

    .load-button,
    .save-button {
        width: 100%;
    }
}

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

    .modal-card {
        padding: 22px 16px 18px;
    }

    .qr-copy-grid {
        grid-template-columns: 1fr;
    }

    .copy-button {
        width: 100%;
    }
}


.load-button,
.save-button,
.copy-button,
.modal-close {
    box-shadow: 0 5px 12px rgba(16, 37, 63, .18);
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        filter .16s ease;
}

.load-button:hover:not(:disabled),
.save-button:hover:not(:disabled),
.copy-button:hover:not(:disabled),
.modal-close:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 17px rgba(16, 37, 63, .24);
    filter: brightness(1.05);
}

.load-button:active:not(:disabled),
.save-button:active:not(:disabled),
.copy-button:active:not(:disabled),
.modal-close:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(16, 37, 63, .17);
}

@media (prefers-reduced-motion: reduce) {
    .slot-number-button,
    .test-button,
    .load-button,
    .save-button,
    .copy-button,
    .modal-close {
        transition: none;
    }
}
