:root {
    --bg-dark: #0b0f19;
    --card-bg: #131b2e;
    --page-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.wrapper {
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Pasek języków */
.lang-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.lang-bar a {
    text-decoration: none;
    color: var(--text-muted);
    background: var(--card-bg);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #26334d;
    transition: 0.2s;
}

.lang-bar a.active, .lang-bar a:hover {
    background: var(--accent);
    color: #0b0f19;
    border-color: var(--accent);
}

/* Ramka banera ze zmieniającymi się kolorami */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes borderSpin {
    0% { --angle: 0deg; filter: hue-rotate(0deg); }
    100% { --angle: 360deg; filter: hue-rotate(360deg); }
}

.animated-border-box {
    position: relative;
    padding: 4px;
    border-radius: 22px;
    background: conic-gradient(from var(--angle), #ff007f, #00f0ff, #7000ff, #00ff88, #ff007f);
    animation: borderSpin 6s linear infinite;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.inner-content {
    background: var(--card-bg);
    border-radius: 19px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.book-header {
    text-align: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.status-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent);
}

/* Efekt książki 3D */
.book-viewport {
    position: relative;
    min-height: 290px;
    perspective: 1400px;
}

.book-page {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 6px 16px 16px 6px;
    padding: 24px 24px 24px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transform-origin: left center;
    opacity: 0;
    pointer-events: none;
    transform: rotateY(-75deg);
    transition: transform 0.75s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease;
    box-shadow: inset 12px 0 20px rgba(0,0,0,0.4), 5px 5px 15px rgba(0,0,0,0.3);
}

/* Grzbiet książki po lewej stronie */
.page-spine {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 14px;
    background: linear-gradient(90deg, #090d16, #27354f, #0f172a);
    border-radius: 6px 0 0 6px;
}

.book-page.active {
    opacity: 1;
    pointer-events: auto;
    transform: rotateY(0deg);
    z-index: 2;
}

.book-page.flipped-out {
    opacity: 0;
    transform: rotateY(-110deg);
    z-index: 1;
}

.deal-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

.page-counter {
    float: right;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.route {
    font-size: 1.45rem;
    margin: 14px 0 6px;
    color: #fff;
}

.price {
    font-size: 1.65rem;
    font-weight: 800;
    color: #4ade80;
}

.dates {
    font-size: 0.9rem;
    color: var(--accent);
    margin: 6px 0 12px;
}

.desc {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin-bottom: 18px;
}

.btn-cta {
    display: inline-block;
    background: linear-gradient(90deg, #0284c7, #2563eb);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 12px 22px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

/* Kontrolki książki */
.book-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.book-controls button {
    background: #1e293b;
    color: #fff;
    border: 1px solid #334155;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.book-controls button:hover {
    background: #334155;
}

.main-portal-link {
    color: var(--accent);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
}

/* Stopka prawna i ITI Data Net Technologi */
.legal-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 0 10px;
}

.legal-footer .credits {
    margin-top: 8px;
    font-weight: 600;
    color: #64748b;
}

.legal-footer a {
    color: #64748b;
    text-decoration: none;
}
