/* The sign-up sheet and the code it reveals (Sheet.cshtml, Reveal.cshtml, signup-offer.js), after Digikala Jet's:
   on a phone a white sheet rising from the bottom over a dimmed page, on a wide screen a dialog in the middle.
   Its colour is the store's own (--ryan-primary, _Root.Head.cshtml). The root is fixed even while hidden, so the
   home page's sheet rows (hero-slider.js) pass it by, and the script moves it under <body> when it opens. */

.tc-so {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-family: inherit;
    --tc-so-brand: var(--ryan-primary, #ef4056);
}

.tc-so[hidden] { display: none; }

.tc-so__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 12, 12, .45);
    opacity: 0;
    transition: opacity .25s ease;
}

.tc-so__panel {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-height: calc(100% - 48px);
    overflow-y: auto;
    padding: 20px 24px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: 24px 24px 0 0;
    background: #fff;
    color: #0c0c0c;
    text-align: center;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}

/* it takes the focus when it opens (signup-offer.js), not one of its buttons: no ring on a phone */
.tc-so__panel:focus { outline: none; }

.tc-so.is-open .tc-so__backdrop { opacity: 1; }
.tc-so.is-open .tc-so__panel { transform: none; }

.tc-so__close {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #424750;
    cursor: pointer;
}

.tc-so__close:hover { background: #f0f0f1; }
.tc-so__close svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.tc-so__art {
    display: block;
    width: 96px;
    height: 72px;
    margin: 28px auto 12px;
}

.tc-so__art svg { display: block; width: 100%; height: 100%; }
.tc-so__note { fill: var(--tc-so-brand); stroke: #fff; stroke-width: 1.5; }
.tc-so__note--back { opacity: .55; }
.tc-so__coin { fill: none; stroke: #fff; stroke-width: 2; }

.tc-so__title {
    margin: 0 0 10px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.8;
    color: #0c0c0c;
}

.tc-so__text {
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.9;
    color: #424750;
}

/* the coupon: a ticket, the code's side and a narrow side cut off by a dashed line with two notches */
.tc-so__card {
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: 92px;
    margin: 0 0 20px;
    border-radius: 14px;
    background: #f5f6f7;
    text-align: right;
}

.tc-so__card::before,
.tc-so__card::after {
    content: "";
    position: absolute;
    left: 88px;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    background: #fff;
}

.tc-so__card::before { top: -7px; }
.tc-so__card::after { bottom: -7px; }

.tc-so__card-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 14px 18px;
}

.tc-so__card-amount { font-size: 17px; font-weight: 700; color: var(--tc-so-brand); }
.tc-so__card-caption { font-size: 12px; color: #62666d; }

.tc-so__card-side {
    display: flex;
    flex: 0 0 88px;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border: 0;
    border-right: 1.5px dashed #d5d8dd;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #424750;
}

/* not signed in yet: the card is only a promise */
.tc-so__card--locked .tc-so__card-main,
.tc-so__card--locked .tc-so__card-side {
    filter: blur(6px);
    user-select: none;
}

.tc-so__code {
    margin-top: 2px;
    font-family: IRANYekanXEn, Tahoma, sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: right;
    color: #0c0c0c;
}

.tc-so__copy { cursor: pointer; color: var(--tc-so-brand); }
.tc-so__copy.is-done { color: #0b7a43; }

.tc-so__note-line {
    margin: -8px 0 20px;
    font-size: 12px;
    line-height: 1.9;
    color: #62666d;
}

/* one note a line: a middle dot reads as a Persian zero (۰) in the store's face */
.tc-so__note-line span { display: block; }

.tc-so__cta {
    display: block;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 12px;
    background: var(--tc-so-brand);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.tc-so__cta:hover { filter: brightness(.95); }
.tc-so__cta:focus-visible,
.tc-so__copy:focus-visible,
.tc-so__close:focus-visible { outline: 2px solid var(--tc-so-brand); outline-offset: 2px; }

html.tc-so-lock,
html.tc-so-lock body { overflow: hidden; }

@media (min-width: 768px) {
    .tc-so { align-items: center; }

    .tc-so__panel {
        width: 440px;
        max-width: calc(100% - 32px);
        padding-bottom: 24px;
        border-radius: 20px;
        transform: translateY(16px) scale(.98);
        opacity: 0;
        transition: transform .25s ease, opacity .25s ease;
    }

    .tc-so.is-open .tc-so__panel { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .tc-so__backdrop,
    .tc-so__panel { transition: none; }
}
