/* Drawers and dialogs, for every screen. Any entry opens in a drawer on the right, the page
   darkened behind it; on a phone it is a sheet across the width. A dialog in the middle is kept
   for a plain confirmation.

   Components/Shared/Drawer.razor draws the shell; the drawers not built on it write the same gl-
   classes themselves and get the same look. Global, under the licences screens' gl- prefix. */

.gl-scrim {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(4, 5, 7, 0.74);
}

.gl-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 111;
    display: flex;
    flex-direction: column;
    width: min(540px, 100vw);
    border-left: 1px solid var(--dark-border-2);
    background: var(--thonon-night);
    box-shadow: -24px 0 64px rgba(0, 0, 0, 0.6);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.45;
    color: #fff;
}

.gl-drawer:focus {
    outline: none;
}

.gl-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--dark-border-1);
}

.gl-drawer__heading {
    flex: 1;
    min-width: 0;
}

.gl-drawer__eyebrow {
    margin: 0;
    font: 700 13px/1.2 var(--font-condensed);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--thonon-yellow);
}

.gl-drawer__title,
.gl-dialog__title {
    margin: 4px 0 0;
    font: 800 24px/1.1 var(--font-condensed);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gl-drawer__sub {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--dark-fg-2);
}

.gl-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--dark-border-2);
    border-radius: var(--radius-control);
    background: none;
    color: var(--dark-fg-2);
    cursor: pointer;
}

.gl-icon-button:hover {
    border-color: var(--dark-fg-2);
    color: #fff;
}

.gl-icon-button:focus-visible {
    outline: 2px solid var(--thonon-yellow);
    outline-offset: 2px;
}

.gl-drawer__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.gl-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

.gl-form-grid .gl-field--wide {
    grid-column: 1 / -1;
}

.gl-drawer__note {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dark-fg-2);
}

.gl-drawer__note strong {
    color: #fff;
}

.gl-drawer__closing {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--dark-border-1);
}

/* The foot: a sentence that says what will happen, then Annuler (text), the secondary action
   (outline) and the main one (yellow), on the right. */
.gl-drawer__foot,
.gl-dialog__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: auto;
    padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--dark-border-1);
    background: var(--thonon-surface-2);
}

.gl-drawer__foot-note {
    flex: 1 1 100%;
    margin: 0 0 2px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--dark-fg-3);
}

.gl-drawer__foot .gi-btn,
.gl-dialog__foot .gi-btn {
    min-height: 44px;
}

/* « Annuler » is a word, not a button. */
.gl-drawer__cancel {
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    background: none;
    color: var(--dark-fg-2);
    font: 800 15px/1 var(--font-condensed);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.gl-drawer__cancel:hover {
    color: #fff;
}

/* ── Dialog: a confirmation, in the middle ──────────────── */

.gl-scrim--center {
    background: rgba(4, 5, 7, 0.78);
}

.gl-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 111;
    display: flex;
    flex-direction: column;
    width: min(460px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    border: 1px solid var(--dark-border-2);
    border-radius: 12px;
    background: var(--thonon-night);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    transform: translate(-50%, -50%);
    overflow: hidden;
}

.gl-dialog__head {
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--dark-border-1);
    background: var(--tint);
}

.gl-dialog__head.gi-tone-neutral {
    background: rgba(255, 255, 255, 0.03);
}

.gl-dialog__eyebrow {
    font: 700 13px/1.2 var(--font-condensed);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tone);
}

.gl-dialog__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 24px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.5;
    color: var(--dark-fg-2);
}

.gl-dialog__error {
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--gi-err-text);
}

.gl-dialog__body p {
    margin: 0;
}

.gl-dialog__body strong {
    color: #fff;
}

/* ── Phone: a sheet from the bottom ─────────────────────── */

@media (max-width: 699px) {
    .gl-drawer {
        top: 56px;
        width: 100%;
        border-left: 0;
        border-top: 1px solid var(--dark-border-2);
        border-radius: 16px 16px 0 0;
    }

    .gl-drawer__head,
    .gl-drawer__body,
    .gl-drawer__foot,
    .gl-dialog__foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    .gl-drawer__foot .gi-btn,
    .gl-dialog__foot .gi-btn {
        flex: 1 1 auto;
    }
}

/* Every form grid takes a single column up to 900 px, a drawer's as a page's. */
@media (max-width: 900px) {
    .gl-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
