:root {
    --bg: #f3f6fb;
    --card: #ffffff;
    --text: #31343b;
    --muted: #697386;
    --line: #e7ecf3;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger-bg: #fff1f2;
    --danger: #be123c;
    --shadow: 0 22px 60px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #ffffff 0, var(--bg) 42%, #eef3f9 100%);
    color: var(--text);
}

a { color: var(--primary); }

.page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.access-card {
    width: min(100%, 400px);
    background: var(--card);
    border-radius: 14px;
    padding: 40px 30px;
    box-shadow: var(--shadow);
    text-align: center;
}

.access-card.wider { width: min(100%, 760px); }

h1 {
    margin: 0 0 8px;
    font-size: 25px;
    line-height: 1.2;
    letter-spacing: -.04em;
}

h2 {
    margin: 0 0 6px;
    font-size: 19px;
}

.intro,
.muted {
    margin: 0 auto 24px;
    color: var(--muted);
    line-height: 1.55;
}

.intro {
    color: var(--text);
    font-size: 17px;
    max-width: 310px;
}

.alert {
    border-radius: 12px;
    padding: 13px 14px;
    margin: 16px 0;
    font-size: 14px;
    text-align: left;
}

.alert.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecdd3;
}

.book-list {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.product-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    text-align: left;
    background: #fbfdff;
}

.product-card p { margin: 0; color: var(--muted); }

.primary-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    color: #fff;
    background: var(--primary);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
    transition: transform .18s ease, background .18s ease;
}

.primary-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-top: 10px;
}

.ghost-link {
    display: inline-block;
    margin-left: 14px;
    color: var(--muted);
    text-decoration: none;
}

.credentials-box {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fbfdff;
    padding: 18px;
    margin: 22px 0;
    text-align: left;
    overflow-wrap: anywhere;
}

.credentials-box p { margin: 8px 0; }

code {
    padding: 3px 7px;
    border-radius: 7px;
    background: #eef2ff;
    color: #1e3a8a;
}

.login-form {
    display: grid;
    gap: 14px;
    text-align: left;
}

.login-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 16px;
    outline: none;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.reader-card { padding-bottom: 42px; }

.book-shell {
    position: relative;
    margin: 20px auto 22px;
    width: min(100%, 340px);
    min-height: 495px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 18px 35px rgba(15,23,42,.08);
    padding: 16px;
}

.book-stage {
    position: relative;
    width: 100%;
    perspective: 1200px;
}

.book-stage::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 4px;
    width: 20px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(15, 23, 42, .22), rgba(255,255,255,0));
    z-index: 2;
    pointer-events: none;
}

.book-page {
    display: block;
    width: 100%;
    max-height: 438px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 30px rgba(15, 23, 42, .18), 0 0 0 1px rgba(15, 23, 42, .08);
    transform-origin: left center;
    transition: opacity .18s ease, transform .28s ease;
}

.book-page.flipping {
    opacity: .35;
    transform: rotateY(-10deg) translateX(5px);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    color: #64748b;
    font-size: 38px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .16);
    z-index: 5;
}

.nav-btn:hover { color: var(--primary); }
.nav-btn.prev { left: 14px; }
.nav-btn.next { right: 14px; }

.reader-meta {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 26px;
}

.logout-link {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
}

.logout-link:hover { color: var(--primary); }

@media (max-width: 560px) {
    .access-card { padding: 28px 18px; }
    .product-card { align-items: stretch; flex-direction: column; }
    .product-card .primary-btn { width: 100%; }
    .book-shell { min-height: 420px; }
    .book-page { max-height: 370px; }
    .nav-btn { width: 38px; height: 38px; font-size: 32px; }
}

.product-info { flex: 1 1 280px; }
.price {
    display: inline-block;
    margin-top: 12px;
    font-size: 20px;
    color: #0f172a;
}
.purchase-form {
    flex: 0 1 280px;
    display: grid;
    gap: 10px;
}
.purchase-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.purchase-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 13px;
    font-size: 15px;
    outline: none;
}
.purchase-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}
.status-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 34px;
    font-weight: 900;
}
.status-icon.success { background: #dcfce7; color: #15803d; }
.status-icon.pending { background: #fef3c7; color: #b45309; }
.status-icon.error { background: #ffe4e6; color: #be123c; }
.payment-wait {
    margin: 18px auto;
    padding: 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    color: var(--muted);
}
.block-link { display: block; margin: 18px 0 0; }

@media (max-width: 560px) {
    .purchase-form { width: 100%; }
}



.book-cover{
    text-align:center;
    margin-bottom:20px;
}

.book-cover img{

    width:180px;

    height:250px;

    object-fit:cover;

    border-radius:12px;

    box-shadow:0 8px 25px rgba(0,0,0,.15);

    transition:.3s;

}

.book-cover img:hover{

    transform:scale(1.04);

}

.product-card{
    display:flex;
    align-items:center;
    gap:25px;
}

.product-cover{
    width:180px;
    flex-shrink:0;
    text-align:center;
}

.product-cover img{
    width:170px;
    border-radius:10px;
    box-shadow:0 10px 25px rgba(0,0,0,.15);
    transition:.3s;
}

.product-cover img:hover{
    transform:scale(1.03);
}