@font-face {
    font-family: "Roboto Condensed";
    src: url("../fonts/RobotoCondensed.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: block;
}

:root {
    --page-bg: #f4f5f7;
    --panel: #ffffff;
    --text: #202938;
    --muted: #667085;
    --border: #d9dee7;
    --border-soft: #eef1f5;
    --input-border: #cfd6e0;
    --accent: #9f1729;
    --accent-hover: #861324;
    --dark: #202938;
    --dark-hover: #111827;
    --focus: rgba(159, 23, 41, .14);
    --font: "Roboto Condensed", "Arial Narrow", "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--page-bg);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
    font-family: var(--font);
}

.pin-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.pin-card {
    width: min(760px, 100%);
    min-height: 480px;
    display: grid;
    grid-template-columns: 280px 1fr;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .08);
    overflow: hidden;
}

.pin-brand {
    padding: 28px;
    border-right: 1px solid var(--border-soft);
    background: #fafbfc;
    display: flex;
    flex-direction: column;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 4px;
    background: var(--dark);
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: .2px;
}

.brand-name {
    margin-top: 18px;
    color: #111827;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.1;
}

.brand-desc {
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.brand-line {
    width: 100%;
    height: 1px;
    margin: 24px 0;
    background: var(--border-soft);
}

.brand-note {
    color: #5f6b7a;
    font-size: 14px;
    font-weight: 400;
    max-width: 220px;
}

.brand-meta {
    margin-top: auto;
    padding-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #7a8494;
    font-size: 12px;
    font-weight: 500;
}

.pin-form-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px 44px;
}

.pin-panel {
    width: 100%;
    max-width: 340px;
}

.form-heading {
    margin-bottom: 20px;
}

.form-heading h1 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.15;
}

.form-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
}

.pin-display {
    height: 48px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    color: var(--text);
    transition: border-color .14s ease, box-shadow .14s ease;
}

.pin-display.is-filled {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus);
}

.pin-placeholder {
    color: #98a2b3;
    font-size: 15px;
    font-weight: 400;
}

.pin-dots {
    display: none;
    color: #111827;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 5px;
    line-height: 1;
}

.pin-display.is-filled .pin-placeholder {
    display: none;
}

.pin-display.is-filled .pin-dots {
    display: block;
}

.pin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.pin-key {
    height: 54px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: #fff;
    color: #111827;
    font-size: 21px;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
    transition: background .14s ease, border-color .14s ease, transform .06s ease;
}

.pin-key:hover {
    background: #f9fafb;
    border-color: #bfc8d4;
}

.pin-key:active {
    transform: translateY(1px);
}

.pin-key-secondary {
    color: #475467;
    font-size: 14px;
    font-weight: 700;
}

.pin-key-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-size: 15px;
}

.pin-key-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.toast-area {
    position: fixed;
    top: 18px;
    right: 18px;
    width: min(360px, calc(100vw - 36px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.app-toast {
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 13px 15px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .12);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
    transform: translateX(14px);
    opacity: 0;
    cursor: pointer;
    transition: opacity .18s ease, transform .18s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.app-toast.hide {
    opacity: 0;
    transform: translateX(14px);
}

.toast-icon {
    width: 21px;
    height: 21px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.toast-content {
    min-width: 0;
    flex: 1;
}

.toast-title {
    color: #111827;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.25;
}

.toast-message {
    margin-top: 2px;
    color: #475569;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
}

.toast-close {
    border: 0;
    background: transparent;
    color: #98a2b3;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    transform-origin: left center;
    animation-name: toastProgress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.app-toast.error .toast-icon,
.app-toast.error .toast-progress {
    background: #b91c1c;
}

.app-toast.success .toast-icon,
.app-toast.success .toast-progress {
    background: #047857;
}

.app-toast.info .toast-icon,
.app-toast.info .toast-progress {
    background: #2563eb;
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 720px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    .pin-page {
        min-height: 100vh;
        height: 100vh;
        padding: 12px;
        place-items: center;
        overflow: hidden;
    }

    @supports (height: 100svh) {
        .pin-page {
            min-height: 100svh;
            height: 100svh;
        }
    }

    .pin-card {
        width: 100%;
        max-width: 420px;
        max-height: calc(100vh - 24px);
        min-height: auto;
        grid-template-columns: 1fr;
    }

    @supports (height: 100svh) {
        .pin-card {
            max-height: calc(100svh - 24px);
        }
    }

    .pin-brand {
        padding: 14px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
        display: grid;
        grid-template-columns: 38px 1fr;
        column-gap: 12px;
        align-items: center;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 4px;
        font-size: 15px;
        grid-row: 1 / span 2;
    }

    .brand-name {
        margin-top: 0;
        font-size: 21px;
        line-height: 1.05;
    }

    .brand-desc {
        margin-top: 2px;
        font-size: 13px;
        line-height: 1.2;
    }

    .brand-line,
    .brand-note,
    .brand-meta {
        display: none;
    }

    .pin-form-area {
        padding: 18px 20px 20px;
    }

    .pin-panel {
        max-width: none;
    }

    .form-heading {
        margin-bottom: 12px;
    }

    .form-heading h1 {
        font-size: 22px;
    }

    .form-heading p {
        margin-top: 4px;
        font-size: 13px;
        line-height: 1.25;
    }

    .pin-display {
        height: 42px;
        margin-bottom: 10px;
    }

    .pin-dots {
        font-size: 20px;
        letter-spacing: 4px;
    }

    .pin-grid {
        gap: 7px;
    }

    .pin-key {
        height: 44px;
        font-size: 19px;
    }

    .pin-key-secondary,
    .pin-key-primary {
        font-size: 13px;
    }

    .toast-area {
        top: 12px;
        right: 12px;
        width: calc(100vw - 24px);
    }
}

@media (max-width: 360px), (max-height: 640px) {
    .pin-page {
        padding: 8px;
    }

    .pin-card {
        max-height: calc(100vh - 16px);
    }

    @supports (height: 100svh) {
        .pin-card {
            max-height: calc(100svh - 16px);
        }
    }

    .pin-brand {
        padding: 10px 12px;
        grid-template-columns: 34px 1fr;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .brand-name {
        font-size: 19px;
    }

    .brand-desc {
        font-size: 12px;
    }

    .pin-form-area {
        padding: 12px 14px 14px;
    }

    .form-heading {
        margin-bottom: 9px;
    }

    .form-heading h1 {
        font-size: 20px;
    }

    .form-heading p {
        font-size: 12px;
    }

    .pin-display {
        height: 38px;
        margin-bottom: 8px;
    }

    .pin-grid {
        gap: 6px;
    }

    .pin-key {
        height: 39px;
        font-size: 18px;
    }
}
