/* ============================================================
   Fonts
   ============================================================ */

@font-face {
    font-family: "Geomanist";

    src:
        url("/fonts/Geomanist-Regular.ttf")
        format("truetype");

    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Geomanist";

    src:
        url("/fonts/Geomanist-Medium.ttf")
        format("truetype");

    font-weight: 500;
    font-style: normal;
    font-display: swap;
}


/* ============================================================
   Design tokens
   ============================================================ */

:root {

    /* Typography */

    --font-family:
        "Geomanist",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    --font-size-body: 16px;
    --font-size-small: 13px;

    --font-size-title: 22px;
    --font-size-section: 20px;

    --font-weight-regular: 400;
    --font-weight-medium: 500;

    --line-height-body: 1.3;
    --line-height-heading: 1.2;


    /* Colors */

    --color-background: #ffffff;
    --color-text: #282d37;
    --color-text-secondary: #50545c;

    --color-border: #d8dadd;

    --color-primary: #ec0016;


    /* Spacing */

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;


    /* Footer */

    --footer-height: 72px;
}


/* ============================================================
   Reset
   ============================================================ */

* {
    box-sizing: border-box;
}

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

body {
    background: var(--color-background);
    color: var(--color-text);

    font-family: var(--font-family);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-regular);

    line-height: var(--line-height-body);

    -webkit-font-smoothing: antialiased;
}


/* ============================================================
   Main ticket
   ============================================================ */

.ticket {
    width: 100%;
    max-width: 600px;

    margin: 0 auto;

    padding:
        20px
        20px
        calc(var(--footer-height) + 32px);
}


/* ============================================================
   Header
   ============================================================ */

.ticket-header {
    display: flex;

    flex-direction: column;
    align-items: center;

    gap: 16px;

    margin-bottom: 20px;
}


/*
 * Leave the images invisible when they don't have a source.
 * This is useful while you're developing the app.
 */

.logo-swiping,
.qrcode,
#bottomsec {
    display: block;
    max-width: 100%;
}


/* QR code */

.qrcode {
    width: 220px;
    height: 220px;

    object-fit: contain;
}


/* ============================================================
   Passenger
   ============================================================ */

.passenger {
    font-size: 16px;
    line-height: 1.3;
}

.passenger-name {
    font-size: 20px;
    font-weight: 400;

    margin-bottom: 2px;
}


/* ============================================================
   Separators
   ============================================================ */

hr {
    border: 0;

    border-top:
        1px solid var(--color-border);

    margin:
        20px 0;
}


/* ============================================================
   Sections
   ============================================================ */

.ticket-section {
    margin-bottom: 20px;
}


/* Main ticket identifier */

h1 {
    margin:
        0 0 22px;

    font-size: var(--font-size-title);
    line-height: var(--line-height-heading);

    font-weight: var(--font-weight-medium);
}


/* Section heading */

h2 {
    margin:
        0 0 4px;

    font-size: var(--font-size-section);
    line-height: var(--line-height-heading);

    font-weight: var(--font-weight-medium);
}


/* ============================================================
   Ticket data
   ============================================================ */

.ticket-data {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-regular);

    line-height: 1.32;
}


/*
 * Individual rows don't have a large margin.
 * This keeps the compact DB-style appearance.
 */

.ticket-data > div {
    margin: 0;
}


/* ============================================================
   Conditions
   ============================================================ */

.conditions p {
    margin:
        0 0 12px;
}

.conditions p:last-child {
    margin-bottom: 0;
}


/* ============================================================
   Ticket code
   ============================================================ */

.ticket-code {
    margin-top: 28px;

    font-size: var(--font-size-small);

    color: var(--color-text-secondary);
}

.ticket-code strong {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}


/* ============================================================
   Bottom graphic
   ============================================================ */

.ticket-bottom {
    display: flex;

    justify-content: center;

    margin-top: 20px;
}

.ticket-bottom img {
    max-width: 100%;
    height: auto;
}


/* ============================================================
   Bottom action bar
   ============================================================ */

.action-footer {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    height: var(--footer-height);

    display: flex;

    justify-content: center;
    align-items: center;

    padding:
        8px
        16px
        calc(8px + env(safe-area-inset-bottom));

    background: var(--color-background);

    border-top:
        1px solid var(--color-border);

    z-index: 100;
}


/* Action button */

.action-button {
    width: 100%;
    max-width: 560px;

    min-height: 48px;

    border: 0;
    border-radius: 24px;

    padding:
        12px
        20px;

    background: var(--color-primary);
    color: #ffffff;

    font-family: var(--font-family);
    font-size: 16px;
    font-weight: var(--font-weight-medium);

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;
}

.action-button:active {
    transform: scale(0.98);
}


/* ============================================================
   Mobile adjustments
   ============================================================ */

@media (max-width: 480px) {

    .ticket {
        padding:
            16px
            16px
            calc(var(--footer-height) + 24px);
    }

    h1 {
        font-size: 21px;
    }

    h2 {
        font-size: 19px;
    }

    .ticket-data {
        font-size: 16px;
    }
}
