@font-face {
    font-family: "Bookido Lato";
    src: url("assets/Lato-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Bookido Lato";
    src: url("assets/Lato-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Bookido Lato";
    src: url("assets/Lato-SemiBold.ttf") format("truetype");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

:root {
    color-scheme: light;
    --bookido-background: #efe0ff;
    --bookido-card-background: #ffffff;
    --bookido-text: #202339;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bookido-background: #150527;
        --bookido-card-background: #32293b;
        --bookido-text: #ffffff;
    }
}

html, body, #bookido-app {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--bookido-background);
}

#bookido-loading {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bookido-background);
}

#bookido-install-required {
    position: fixed;
    inset: 0;
    display: none;
    box-sizing: border-box;
    height: 100%;
    align-items: flex-start;
    justify-content: center;
    padding:
        max(16px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--bookido-background);
    color: var(--bookido-text);
    font-family: "Bookido Lato", Lato, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 20px;
    text-align: left;
}

.bookido-install-content {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
    width: min(100%, 640px);
    min-height: 100%;
    min-width: 0;
    margin: 0;
    padding: 32px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bookido-card-background);
}

.bookido-install-title {
    margin: 0;
    color: var(--bookido-text);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.24;
}

.bookido-install-text,
.bookido-install-step-heading {
    margin: 0;
}

.bookido-install-step-heading {
    position: relative;
    box-sizing: border-box;
    min-height: 20px;
    padding-left: 22.5px;
}

.bookido-install-step-heading[data-step]::before {
    position: absolute;
    left: 4px;
    content: attr(data-step) ".";
}

.bookido-install-step-heading--second {
    width: min(306px, 100%);
    min-height: 40px;
}

.bookido-install-picture {
    display: block;
    width: 100%;
    line-height: 0;
    text-align: center;
}

.bookido-install-picture img {
    display: block;
    width: min(100%, 576px);
    height: auto;
    margin: 0 auto;
}

.bookido-telegram-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-right: 16px;
    padding-left: 16px;
}

.bookido-telegram-layout {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    margin-top: clamp(72px, 18vh, 260px);
    white-space: nowrap;
}

.bookido-telegram-title {
    z-index: 1;
    display: block;
    width: 49.589vw;
    flex: 0 0 auto;
    margin: 0;
    color: var(--bookido-text);
    font-size: 4.528vw;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}

.bookido-telegram-title-line {
    display: block;
}

.bookido-telegram-title-first-line {
    display: block;
    white-space: nowrap;
}

.bookido-telegram-browser-icon {
    display: inline-block;
    width: 7vw;
    height: 7vw;
    margin-left: 0.8vw;
    vertical-align: middle;
}

.bookido-telegram-pointer {
    z-index: 0;
    display: block;
    width: auto;
    height: calc(100% - 18px - 2.83vw);
    flex: 0 0 auto;
    margin: 2.83vw 8px 18px 3.2vw;
    pointer-events: none;
}

@media (min-width: 500px) {
    .bookido-telegram-title {
        width: 247.945px;
        font-size: 22.64px;
    }

    .bookido-telegram-browser-icon {
        width: 35px;
        height: 35px;
        margin-left: 4px;
    }

    .bookido-telegram-pointer {
        height: calc(100% - 32.15px);
        margin: 14.15px 8px 18px 16px;
    }
}

.bookido-telegram-browser #bookido-install-required {
    align-items: stretch;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

.bookido-install-required #bookido-install-required {
    display: flex;
}

.bookido-install-required #bookido-loading,
.bookido-install-required #bookido-app {
    display: none;
}

.bookido-spinner {
    width: 48px;
    height: 48px;
    animation: bookido-spinner-rotate 1.4s linear infinite;
}

.bookido-spinner circle {
    fill: none;
    stroke: #8a5eb8;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 80 200;
    stroke-dashoffset: 0;
}

.bookido-brand {
    position: absolute;
    bottom: max(24px, env(safe-area-inset-bottom));
    display: block;
    width: 156px;
    height: 60px;
    object-fit: contain;
}

.bookido-camera-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    background: #000;
    touch-action: none;
}

.bookido-camera-preview {
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    object-fit: cover;
}

.bookido-camera-controls {
    position: absolute;
    right: 0;
    bottom: max(24px, env(safe-area-inset-bottom));
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
}

.bookido-camera-cancel,
.bookido-camera-shutter {
    border-radius: 50%;
}

.bookido-camera-cancel {
    width: 52px;
    height: 52px;
    border: 0;
    color: #fff;
    background: rgb(0 0 0 / 55%);
    font-size: 34px;
    line-height: 1;
}

.bookido-camera-shutter {
    width: 76px;
    height: 76px;
    border: 5px solid #fff;
    background: rgb(255 255 255 / 30%);
    box-shadow: 0 0 0 2px rgb(0 0 0 / 25%);
}

@keyframes bookido-spinner-rotate {
    100% { transform: rotate(360deg); }
}
