/* Ported from pass.cardlyapp.ru/style.css (menu/account styles dropped);
   mock-only additions are at the bottom. */
:root {
    --accent: #EE8147;
    --btn-grad-start: #d7387d;
    --btn-grad-end: #EE8147;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, sans-serif;
    background: #fff;
    color: #111;
    padding: 24px;
}

@media (prefers-color-scheme: dark) {
    body {
        background: #111;
        color: #f5f5f5;
    }

    input {
        background: #1e1e1e;
        border-color: #333;
        color: #f5f5f5;
    }

    input:focus {
        border-color: var(--accent);
    }

    .logo-wrap {
        border-color: #333;
    }

    .btn-siwa {
        background: #fff !important;
        color: #000 !important;
        border-color: #fff !important;
    }

    .btn-siwg {
        background: #1e1e1e !important;
        color: #f5f5f5 !important;
        border-color: #333 !important;
    }

    .btn-skip {
        color: #555 !important;
    }
}

.screen {
    display: none;
    width: 100%;
    max-width: 320px;
    flex-direction: column;
    gap: 10px;
}

.screen.active {
    display: flex;
}

.logo-wrap {
    width: 100%;
    border: 1.5px dashed #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2px;
}

.logo-wrap img {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.tagline {
    margin: 0 0 4px;
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    line-height: 1.4;
}

input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

input:focus {
    border-color: var(--accent);
}

button {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--btn-grad-start), var(--btn-grad-end));
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.15s;
}

button:hover {
    opacity: 0.88;
}

button:disabled {
    opacity: 0.45;
    cursor: default;
}

.btn-siwa,
.btn-siwg {
    background: #fff;
    color: #111;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 12px 14px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-siwa {
    background: #000;
    color: #fff;
    border-color: #000;
}

.btn-siwa svg,
.btn-siwg svg {
    flex-shrink: 0;
}

.btn-skip {
    background: none;
    color: #aaa;
    font-size: 0.85rem;
    padding: 6px;
}

.error-msg {
    font-size: 0.82rem;
    color: #c0392b;
    text-align: center;
    display: none;
}

.error-msg.visible {
    display: block;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.btn-loading>* {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: btn-spin 0.65s linear infinite;
}

.btn-siwg.btn-loading::after {
    border-color: rgba(0, 0, 0, 0.12);
    border-top-color: #444;
}

/* Apple Wallet badge — follows Apple HIG */
.btn-apple-wallet {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: block;
    transition: opacity 0.15s;
}

.btn-apple-wallet:hover {
    opacity: 0.88;
}

.btn-apple-wallet img {
    width: 75%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ── Card info (balance / number / history) ── */
.card-info {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-balance {
    font-size: 1.8rem;
    font-weight: 700;
}

.card-balance span + span {
    font-size: 0.9rem;
    font-weight: 400;
    color: #888;
}

.card-number {
    font-family: ui-monospace, monospace;
    font-size: 0.9rem;
    color: #888;
    letter-spacing: 0.12em;
}

.txn-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.txn-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #666;
}

.txn-delta-pos {
    color: #16a34a;
    font-weight: 600;
}

.txn-delta-neg {
    color: #c0392b;
    font-weight: 600;
}

.section-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #aaa;
    margin: 8px 0 0;
}

.screen-title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
}

.btn-danger {
    background: none;
    border: 1px solid rgba(192, 57, 43, 0.35);
    color: #c0392b;
    font-size: 0.85rem;
    padding: 10px;
}

.btn-danger-link {
    background: none;
    color: #aaa;
    font-size: 0.78rem;
    padding: 4px;
}

@media (prefers-color-scheme: dark) {
    .card-info {
        border-color: #333;
    }
}

/* ══ Mock-only additions ═════════════════════════════════ */

.tagline b {
    color: #111;
    font-weight: 600;
    word-break: break-all;
}

.note {
    margin: 0;
    font-size: 0.78rem;
    color: #999;
    text-align: center;
    line-height: 1.4;
}

.ok-line {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #16a34a;
    text-align: center;
    line-height: 1.4;
}

.btn-link {
    background: none;
    color: var(--accent);
    font-size: 0.88rem;
    padding: 6px;
}

.btn-secondary {
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 12px;
}

.btn-secondary.btn-loading::after,
.btn-link.btn-loading::after {
    border-color: rgba(0, 0, 0, 0.12);
    border-top-color: var(--accent);
}

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
    font-size: 0.8rem;
    color: #aaa;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #e5e5e5;
}

.code-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.4em;
    padding-left: calc(14px + 0.4em);
    font-family: ui-monospace, monospace;
}

.code-input::placeholder {
    color: #ccc;
}

.label {
    margin: 0;
    font-size: 0.82rem;
    color: #888;
}

/* Optional add-ons under the wallet badge (phone, email confirmation). */
.addon {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.addon-title {
    margin: 0;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.4;
}

.addon .code-input {
    font-size: 1.25rem;
}

/* ── Bottom sheet (OAuth stand-in, fake Wallet sheet) ── */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s;
}

.sheet-backdrop.in {
    opacity: 1;
}

.sheet {
    width: 100%;
    max-width: 420px;
    padding: 18px 20px calc(22px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateY(100%);
    transition: transform 0.25s ease;
}

.sheet-backdrop.in .sheet {
    transform: none;
}

.sheet-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
}

.wsheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.wsheet-head button {
    width: auto;
    background: none;
    color: #0a84ff;
    padding: 6px 2px;
    font-size: 1rem;
}

.wsheet-head span {
    font-weight: 600;
}

/* A rough stand-in for the pass the real Wallet sheet would preview. */
.pass-preview {
    margin: 6px 0;
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(160deg, #4a6cf0, #3a55d8);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.pass-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pass-top img {
    height: 30px;
    border-radius: 6px;
}

.pass-field {
    text-align: right;
}

.pass-field small {
    display: block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.pass-field b {
    font-size: 1.3rem;
}

.pass-barcode {
    align-self: center;
    padding: 10px 14px 6px;
    border-radius: 6px;
    background: #fff;
    color: #111;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: ui-monospace, monospace;
    font-size: 0.72rem;
}

.pass-barcode i {
    display: block;
    width: 190px;
    height: 46px;
    background: repeating-linear-gradient(90deg,
            #111 0 2px, #fff 2px 4px, #111 4px 5px, #fff 5px 8px,
            #111 8px 11px, #fff 11px 12px, #111 12px 13px, #fff 13px 16px);
}

/* ── Fake push notification (stands in for the email / SMS) ── */
.notif {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    left: 50%;
    z-index: 50;
    width: min(380px, calc(100% - 20px));
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(246, 246, 246, 0.94);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    color: #111;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-align: left;
    cursor: pointer;
    transform: translate(-50%, calc(-100% - 40px));
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

.notif.in {
    transform: translate(-50%, 0);
}

.notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.notif-icon.mail {
    background: linear-gradient(180deg, #1ea1ff, #0a6cff);
}

.notif-icon.sms {
    background: linear-gradient(180deg, #5ef27a, #23c244);
}

.notif-body {
    min-width: 0;
    flex: 1;
}

.notif-app {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #777;
}

.notif-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.notif-text {
    font-size: 0.88rem;
    line-height: 1.3;
    word-break: break-word;
}

.notif-hint {
    margin-top: 4px;
    font-size: 0.72rem;
    color: #999;
}

@media (prefers-color-scheme: dark) {
    .tagline b {
        color: #f5f5f5;
    }

    .divider::before,
    .divider::after,
    .addon {
        border-color: #333;
    }

    .code-input::placeholder {
        color: #555;
    }

    .sheet {
        background: #1c1c1e;
    }

    .notif {
        background: rgba(44, 44, 46, 0.94);
        color: #f5f5f5;
    }

    .notif-app {
        color: #aaa;
    }
}

@media (prefers-reduced-motion: reduce) {

    .sheet,
    .sheet-backdrop,
    .notif {
        transition: none;
    }
}
