/* Same colours as the app (android-agent/.../ui/theme/Theme.kt). */
:root {
    --purple: #531C78;
    --navy: #214469;
    --red: #9B2423;
    --accent: #2885AD;
    --cyan: #11D2E9;
    --green: #098757;
    --background: #F2F0F5;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
    font-family: Roboto, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--navy);
    background: var(--background) url("img/app_background.png") center center / cover no-repeat fixed;
    -webkit-text-size-adjust: 100%;
}

button, input, select { font-family: inherit; font-size: inherit; }

#app {
    max-width: 520px;
    min-height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.center-text { text-align: center; }
.hidden { display: none !important; }

/* Header: logo at the start, company name at the end. */
.brand {
    display: flex;
    align-items: center;
    padding: 10px 16px;
}
.brand img { height: 42px; width: auto; }
.brand .company {
    flex: 1;
    text-align: end;
    margin-inline-start: 12px;
    font-weight: bold;
    font-size: 16px;
    color: var(--navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer {
    background: #E5E5E5;
    color: #444;
    font-size: 12px;
    text-align: center;
    padding: 10px;
    direction: ltr;
}

.welcome {
    color: #700B1E;
    font-weight: 600;
    text-align: center;
    margin: 4px 0;
}

.title {
    color: var(--navy);
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin: 0 0 8px;
}
.section-title { color: var(--navy); font-size: 16px; font-weight: 600; }
.label { color: var(--navy); font-size: 14px; }

.error { color: var(--red); text-align: center; }

/* Language capsule and the round button in the opposite corner. */
.lang-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.capsule {
    position: relative;
    display: flex;
    gap: 7px;
    padding: 3px;
    width: 176px;
    height: 58px;
}
.capsule svg { position: absolute; top: 0; left: 0; }
.capsule .flag {
    position: relative;
    width: 52px;
    height: 52px;
    border: 0;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.capsule .flag span {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.capsule .flag.selected span { background: #7CB342; }
.capsule .flag img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.round-button {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 3px solid #E2E2E2;
    background: var(--navy);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.round-button span {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--red);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
[dir="rtl"] .round-button .fa-right-from-bracket { transform: scaleX(-1); }
[dir="rtl"] .fa-arrow-left { transform: scaleX(-1); }

/* Text fields: outlined with the label in a notch, like the app. */
.field {
    margin: 0;
    padding: 0 12px 4px;
    border: 1px solid #79747E;
    border-radius: 4px;
    background: transparent;
    display: flex;
    align-items: center;
    min-width: 0;
}
.field:focus-within { border: 2px solid var(--purple); padding: 0 11px 3px; }
.field legend {
    padding: 0 4px;
    font-size: 12px;
    color: #49454F;
}
.field:focus-within legend { color: var(--purple); }
.field i { color: var(--red); margin-inline-end: 12px; font-size: 18px; }
.field input, .field select {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1C1B1F;
    font-size: 16px;
}
.field select { -webkit-appearance: none; appearance: none; cursor: pointer; }
.field .fa-caret-down { color: #49454F; margin: 0; margin-inline-start: 8px; }

.card-plain { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-plain.menu-title { margin-bottom: 24px; }
.login-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }

/* Buttons. */
.btn {
    border: 0;
    border-radius: 12px;
    background: var(--purple);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn.navy { background: var(--navy); }
.btn:disabled { background: rgba(28, 27, 31, 0.12); color: rgba(28, 27, 31, 0.38); cursor: default; }
.btn.login { border-radius: 8px; min-height: 40px; width: 100%; margin-top: 8px; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }
.big {
    flex-direction: column;
    padding: 18px 8px;
    font-size: 16px;
    gap: 4px;
}
.big i { font-size: 26px; }
.full { width: 100%; }
.link-button {
    background: none;
    border: 0;
    color: var(--red);
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
}

/* Info lines below the buttons. */
.info-line { display: flex; align-items: flex-start; gap: 6px; padding: 3px 0; font-size: 12px; color: var(--navy); }
.info-line i { font-size: 15px; margin-top: 1px; }
.apk-link { color: var(--purple); font-weight: 600; text-decoration: underline; }

/* Home: user line and bell. */
.user-row { display: flex; align-items: center; gap: 6px; }
.user-row .fa-user { color: var(--red); font-size: 20px; }
.user-row .name { flex: 1; font-weight: 600; font-size: 15px; }
.user-row button.name {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font-family: inherit;
    text-align: start;
    cursor: pointer;
}
.error:empty { display: none; }
.bell {
    position: relative;
    background: none;
    border: 0;
    color: var(--purple);
    font-size: 22px;
    width: 48px;
    height: 48px;
    cursor: pointer;
}
.bell .badge {
    position: absolute;
    top: 6px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    font-style: normal;
}

/* Navy cards (received packages, active guest codes). */
.navy-card {
    background: var(--navy);
    border-radius: 12px;
    padding: 16px;
    color: #fff;
}
.navy-card h3 { margin: 0 0 8px; color: var(--cyan); text-align: center; font-size: 15px; }
.navy-card .empty { font-size: 13px; }
.row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 8px;
}
.row.clickable { cursor: pointer; }
.row > i { color: var(--cyan); font-size: 17px; width: 20px; text-align: center; }
.row .main { flex: 1; min-width: 0; }
.row .main div:first-child { font-size: 13px; }
.row .sub { font-size: 11px; color: rgba(255, 255, 255, 0.7); }
.row .date { color: var(--cyan); font-size: 11px; padding: 4px 6px; border-radius: 8px; white-space: nowrap; }
.row .date.action { border: 1px solid var(--cyan); background: none; cursor: pointer; font: inherit; font-size: 11px; color: var(--cyan); direction: ltr; unicode-bidi: isolate; }

/* Size tiles. */
.sizes { display: flex; gap: 12px; }
.size {
    flex: 1;
    height: 110px;
    border: 0;
    border-radius: 12px;
    background: var(--purple);
    color: #fff;
    cursor: pointer;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.size.selected { box-shadow: inset 0 0 0 3px var(--navy); }
.size.dim { opacity: 0.4; }
.size:disabled { opacity: 0.3; cursor: default; }
.size .name { font-weight: 600; font-size: 15px; margin-top: 6px; }
.size .free { font-size: 11px; color: rgba(255, 255, 255, 0.85); }

/* Validity pills. */
.hours { display: flex; gap: 8px; }
.hours button {
    flex: 1;
    height: 40px;
    border-radius: 20px;
    border: 1px solid var(--purple);
    background: transparent;
    color: var(--purple);
    font-weight: 600;
    cursor: pointer;
}
.hours button.selected { background: var(--purple); color: #fff; }

.divider { border: 0; border-top: 1px solid rgba(33, 68, 105, 0.25); margin: 8px 0; }

.spinner {
    width: 36px;
    height: 36px;
    margin: 8px auto;
    border: 4px solid rgba(83, 28, 120, 0.2);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Popups in the app's IboxDialog style. */
.overlay {
    position: fixed;
    inset: 0;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    z-index: 10;
}
.dialog {
    width: 100%;
    max-width: 400px;
    max-height: 100%;
    overflow-y: auto;
    background: var(--background);
    border: 2px solid var(--navy);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.dialog > img { height: 30px; }
.dialog h2 { margin: 0; font-size: 20px; text-align: center; color: var(--navy); }
.dialog .body { width: 100%; text-align: center; color: var(--navy); }
.dialog .actions { width: 100%; display: flex; gap: 12px; }
.dialog .actions .btn { flex: 1; min-width: 0; }

.notif-list { max-height: 400px; overflow-y: auto; text-align: start; }
.notif-list .item { padding: 6px 0; border-top: 1px solid rgba(33, 68, 105, 0.2); font-size: 13px; }
.notif-list .item:first-child { border-top: 0; }
.notif-list .item.unread { font-weight: bold; }
.notif-list .when { font-size: 11px; color: #777; font-weight: normal; }

.pin { font-size: 34px; font-weight: bold; letter-spacing: 6px; color: var(--purple); }
.message-label { font-size: 12px; font-weight: 600; text-align: start; margin: 12px 0 4px; }
.message {
    background: #fff;
    border: 1px solid rgba(33, 68, 105, 0.2);
    border-radius: 10px;
    padding: 10px;
    text-align: start;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.message img { height: 26px; display: block; margin-bottom: 6px; }
.message a { color: #1A73E8; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 60px;
    transform: translateX(-50%);
    background: rgba(33, 33, 33, 0.9);
    color: #fff;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 20;
}

/* Guest pages. */
.guest-page { align-items: center; justify-content: center; text-align: center; gap: 20px; }
.guest-page .big-icon { font-size: 64px; color: var(--green); }
.guest-page .thanks { font-size: 20px; font-weight: bold; color: var(--navy); }
.guest-page .door { font-size: 16px; color: var(--navy); }
