/*tokens*/
body {
    /*colors*/
    color-scheme: light dark;

    --base: #F5F5F3, #1C1C1A;
    --subtle: #E8E8E4, #2A2A27;
    --medium: #B5B5B0, #5A5A55;
    --muted: #7A7A75, #9A9A95;
    --main: #1C1C1A, #E8E8E4;
    --beneath: #E8E8E4, #000;
    --accent: #B8860B, #E9B44C;
    --accent-bg: #FDF3D7, #3D3524;
    --screen: #ffffffbf, #000000bf;
    --shade: #F5F5F3E0, #1C1C1AE0;
    --green: #3D7A4A, #5FAD6B;
    --red: #B54234, #D96A5B;

    /*font*/
    --inter: 'Inter', sans-serif;

    /*space*/
    --container-width: 960px;
    --corner-radius: 8px;

    /* iOS Safe Area */
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --safe-area-inset-left: env(safe-area-inset-left);
    --safe-area-inset-right: env(safe-area-inset-right);

    /* General Styles */
    color: light-dark(var(--main));
    font-family: var(--inter);
    font-size: 16px;
    background: light-dark(var(--base));

    /* Layout */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);

    /* Text colors */
    .main {
        color: light-dark(var(--main));
    }

    .muted {
        color: light-dark(var(--muted));
    }

    .medium {
        color: light-dark(var(--medium));
    }

    .accent {
        color: light-dark(var(--accent));
    }
}

/* General Styles */
h1 {
    font-size: 28px;
    line-height: 100%;
    font-weight: bold;
    padding-bottom: 16px;
    color: light-dark(var(--main));
    margin: 0;
}

h2 {
    font-size: 18px;
    line-height: 24px;
    font-weight: normal;
    margin: 0;
    padding: 0;
    color: light-dark(var(--muted));
}

h3 {
    font-size: 16px;
    line-height: 24px;
    font-weight: normal;
    margin: 0;
    color: light-dark(var(--main));
}

a {
    color: inherit;
    font-weight: normal;
}

p {
    margin: 0;
    padding: 0 0 24px;
}

.description {
    color: light-dark(var(--muted));
}

/* Layout */
body {
    background: light-dark(var(--beneath));
}

#container {
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    padding: 0;
    height: 100vh;
    min-height: 100vh;
    width: 100%;
    max-width: var(--container-width);
    overflow-y: auto;
    overflow-x: hidden;
    background: light-dark(var(--base));
    /*padding-top: env(safe-area-inset-top);*/
}

#content,
nav,
footer {
    opacity: 0;
}

main {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: auto;
    flex: 1;
    padding: 0 24px 24px;
}

footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    box-sizing: border-box;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: auto;
    max-width: var(--container-width);
    padding: 24px;
    background: linear-gradient(transparent, light-dark(var(--shade)), light-dark(var(--base)));
    z-index: 2;
}

.actions {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 8px;
    justify-content: flex-end;
}

nav {
    display: flex;
    position: sticky;
    opacity: 0;
    justify-content: flex-end;
    align-items: center;
    top: 0;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    max-width: var(--container-width);
    padding: 24px;
    /*padding-top: max(24px, env(safe-area-inset-top));*/
    background: linear-gradient(light-dark(var(--base)), light-dark(var(--shade)), transparent);
    z-index: 2;
}

#menu {
    position: fixed;
    box-sizing: border-box;
    top: 0;
    display: none;
    height: 100vh;
    width: 100vw;
    background: light-dark(var(--screen));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2;
}

#menu #menu-container {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    justify-content: flex-start;
    align-items: flex-end;
    width: 100%;
    max-width: var(--container-width);
    gap: 20px;
    padding: 24px;
    /*padding-top: max(24px, calc(16px + env(safe-area-inset-top)));*/
    margin: 0 auto;
}

#menu .menu-list {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
}

#container.sheet {
    position: relative;
    height: auto;
    min-height: calc(100% - 200px);
    margin-top: 24px;
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
}

.beneath {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    gap: 8px;
    padding: 16px;
    opacity: 100%;
    margin-bottom: -48px;
}

article p,
article ul,
article ol {
    line-height: 20px;
    padding-bottom: 24px;
}

article h2 {
    padding-bottom: 8px;
}

/* Buttons */
button {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    min-height: 48px;
    min-width: 48px;
    width: auto;
    padding: 0 24px;
    border-radius: var(--corner-radius);
    font-size: 16px;
    background-color: light-dark(var(--accent));
    color: light-dark(var(--base));
    white-space: nowrap
}

button.icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--corner-radius);
}

button.secondary {
    background-color: light-dark(var(--subtle));
    color: light-dark(var(--main));
}

button.tertiary {
    background-color: light-dark(var(--base));
    box-shadow: inset 0 0 0 1px light-dark(var(--medium));
    color: light-dark(var(--main));
}

button.small {
    min-height: 32px;
    height: 32px;
}

button.icon.small {
    width: 32px;
    min-width: 32px;
}

.stacked-buttons {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    flex-direction: column;
    gap: 16px;
}

button.full-width {
    width: 100%;
    flex: 1;
}

.stacked-buttons button {
    width: 100%;
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

form section {
    display: flex;
    flex-direction: column;
    gap: inherit;
}

.form-row {
    display: flex;
    flex-direction: row;
    box-sizing: border-box;
    gap: 8px;
    width: 100%;
}

.form-row>* {
    flex: 1 1 50% !important;
}

/* Inputs */
input,
input[type="date"],
select {
    font-size: 16px;
    border: none;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

input::placeholder {
    color: light-dark(var(--medium));
}

.input-combo {
    position: relative;
    display: flex;
    flex: 1;
    box-sizing: border-box;
    flex-direction: column;
    justify-content: center;
    background: light-dark(var(--base));
    box-shadow: 0 0 0 1px light-dark(var(--medium));
    padding: 0;
    border-radius: var(--corner-radius);
    height: 48px;
    min-height: 48px;
    max-width: 100%;
    overflow: hidden;
}

.input-combo:has(input:focus) {
    box-shadow: 0 0 0 1px light-dark(var(--muted));
}

.input-combo label {
    position: absolute;
    top: 14px;
    left: 16px;
    color: light-dark(var(--muted));
    transition: top 96ms ease;
}

.input-combo:has(input:focus) label,
.input-combo:has(input:not(:placeholder-shown)) label,
.input-combo:has(select option:checked:not([value=""])) label {
    position: absolute;
    top: 6px;
    left: 16px;
    color: light-dark(var(--muted));
    font-size: 12px;
}

.input-container {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    box-sizing: border-box;
    background: transparent;
    padding: 0;
    border-radius: var(--corner-radius);
    height: 48px;
    width: 100%;
}

.input-container:not(.input-combo .input-container):has(input:focus) {
    border: 1px solid light-dark(var(--muted));
    padding-left: 16px;
}

.input-container .input-button {
    display: none;
    opacity: 0;
    border-radius: 0 var(--corner-radius), ;
    transition: opacity 200ms ease;
}

.input-container .input-button.show {
    display: flex;
    opacity: 1;
}

.input-container:has(input:not(:placeholder-shown)) .input-button {
    display: flex;
}

.input-combo input {
    display: flex;
    flex-direction: row;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 12px 16px 0;
    background: transparent;
    font-size: inherit;
    border-radius: var(--corner-radius);
    height: 48px;
    overflow: hidden;
    border: none;
}

.input-combo select {
    border: none;
    background: transparent;
    padding: 12px 16px 0;
    margin: 0;
    font-size: inherit;
    width: 100%;
    box-sizing: border-box;
    /* Hide default arrow */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Add padding for custom arrow space */
    padding-right: 24px;
}

/* Add custom arrow */
.input-combo:has(select)::after {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 48px;
    border-radius: 50%;
    color: light-dark(var(--muted));
    content: '▾';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-combo input:focus,
.input-combo select:focus,
.input-container input:focus {
    outline: none;
}

/* Special styles for currency input */
.input-combo.currency:has(input:focus)::before,
.input-combo.currency:has(input:not(:placeholder-shown))::before {
    content: '$';
    position: absolute;
    left: 16px;
    top: 21px;
    color: light-dark(var(--muted));
    pointer-events: none;
    z-index: 1;
}

.input-combo.currency:has(input:focus) input,
.input-combo.currency:has(input:not(:placeholder-shown)) input {
    padding-left: 28px;
}

/* Style the calendar icon specifically */
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
}

input:disabled {
    color: light-dark(var(--muted));
    cursor: not-allowed;
}

.input-combo:has(input:disabled) {
    border: none;
    background: light-dark(var(--subtle));
}

.input-message {
    font-size: 14px;
    color: light-dark(var(--muted));
    margin-top: -8px;
}

/* Checkbox and radio buttons */

.checkbox-list,
.radio-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
}

.checkbox-container,
.radio-container {
    display: flex;
    align-items: center;
    height: 48px;
    width: 100%;
    box-sizing: border-box;
    gap: 12px;
    background: light-dark(var(--subtle));
    padding: 0 16px;
    border-radius: var(--corner-radius);
}

input[type="checkbox"] {
    /* Remove default appearance */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Your custom styling */
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    box-shadow: 0 0 0 1px light-dark(var(--medium));
    border-radius: var(--corner-radius);
    background: light-dark(var(--base));
    cursor: pointer;
    margin: 0;
    padding: 0;
    position: relative;
}

input[type="checkbox"]:checked {
    background: light-dark(var(--accent));
    border-color: light-dark(var(--accent));
}

input[type="checkbox"]:checked::after {
    content: '✔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: light-dark(var(--base));
    font-size: 16px;
}

input[type="radio"] {
    /* Remove default appearance */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Your custom styling */
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    box-shadow: 0 0 0 1px light-dark(var(--medium));
    border-radius: 50%;
    background: light-dark(var(--base));
    cursor: pointer;
    margin: 0;
    padding: 0;
    position: relative;
}

input[type="radio"]:checked {
    background: light-dark(var(--accent));
}

/* Pills */
.pill {
    display: inline-flex;
    align-items: center;
    background: light-dark(var(--subtle));
    color: light-dark(var(--muted));
    min-height: 24px;
    padding: 0 8px;
    border-radius: var(--corner-radius);
    user-select: none;
}

/* Tabs */
#tabs {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    background: light-dark(var(--subtle));
    border-radius: var(--corner-radius);
    margin-bottom: 24px;
}

.tab {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 24px;
    box-sizing: border-box;
    background: none;
    border: none;
    border-radius: var(--corner-radius);
    cursor: pointer;
    color: light-dark(var(--muted));
    min-height: 32px;
    flex: 1;
}

.tab.active {
    background: light-dark(var(--medium));
    color: light-dark(var(--main));
}

/* Toasts */
.toast {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--corner-radius);
    box-sizing: border-box;
    background: light-dark(var(--subtle));
}

.error {
    color: light-dark(var(--red));
}

.success {
    color: light-dark(var(--green));
}

.info {
    color: light-dark(var(--muted));
}

/* Lists */
.list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-row {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    gap: 4px;
}

ul,
ol {
    padding-left: 16px;
    margin: 0
}

/* Cards */

.cards-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 16px;
    background: light-dark(var(--subtle));
    border-radius: var(--corner-radius);
    gap: 4px;
    cursor: pointer;
}

.card.highlight {
    background: light-dark(var(--accent-bg));
}

.card-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-weight: bold;
}

.card-details {
    color: light-dark(var(--muted));
}

.card-count {
    display: inline-flex;
    box-sizing: border-box;
    height: 24px;
    width: auto;
    padding: 0 8px;
    justify-content: center;
    align-items: center;
    background: light-dark(var(--accent-bg));
    color: light-dark(var(--accent));
    border-radius: var(--corner-radius);
    font-size: 14px;
}

.card-tag {
    color: light-dark(var(--main));
}

/* Modal */
.modal-bg {
    position: fixed;
    box-sizing: border-box;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: light-dark(var(--screen));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 3;
}

.modal {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    background: light-dark(var(--base));
    border-radius: 16px 16px 0 0;
    padding: 16px;
    gap: 48px;
}

.modal-close-button {
    align-self: flex-end;
}

.modal-content {
    display: flex;
    flex-direction: column;
    padding: 0 8px;
}

/* Profile */
.avatar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: light-dark(var(--medium));
    color: light-dark(var(--main));
}

.profile {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-unit {
    color: light-dark(var(--muted));
}

.you-tag::before {
    content: "(You)";
    color: light-dark(var(--muted));
}

/* Transitions and animations */

.hidden {
    display: none !important;
}

#greeting {
    opacity: 0;
}

/* Auth */

.auth-form {
    display: flex;
    flex-direction: column;
    padding: 24px 0;
}

#hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    padding: 0;
    color: light-dark(var(--medium));
    gap: 24px;
}

#hero svg {
    width: 100%;
    max-width: 560px;
    height: auto;
}

#hero_car {
    animation: car-move 6.4s ease-in-out infinite;
}

@keyframes car-move {
    0% {
        transform: translateX(-200px);
    }

    100% {
        transform: translateX(200px);
    }
}

/* Home Page */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 48px;
    padding-top: 16px;
}

.dashboard-section {
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding-bottom: 8px;
    color: light-dark(var(--muted));
}

.count-badge {
    display: inline-flex;
    box-sizing: border-box;
    height: 24px;
    width: 24px;
    justify-content: center;
    align-items: center;
    background: light-dark(var(--subtle));
    color: light-dark(var(--accent));
    font-size: 14px;
    font-weight: bold;
    border-radius: 50%;
}

.dashboard .section-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard .card {
    gap: 4px;
}

.list-item-details {
    color: light-dark(var(--muted));
    font-size: 14px;
}

#offers-received-list .card {
    background: light-dark(var(--accent-bg));
}

.empty-message {
    display: block;
    padding: 16px;
    box-sizing: border-box;
    border-radius: var(--corner-radius);
    box-shadow: inset 0 0 0 1px light-dark(var(--subtle));
    color: light-dark(var(--muted));
}

/* Details page */
.details-page {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

section {
    display: flex;
    flex-direction: column;
}

.label {
    color: light-dark(var(--muted));
}

.one-liner {
    padding-bottom: 8px;
}

.row {
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
}

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    box-sizing: border-box;
    color: light-dark(var(--muted));
    text-transform: capitalize;
}

.status.accepted {
    color: light-dark(var(--green));
}

.status.pending {
    color: light-dark(var(--accent));
}

.status.declined {
    color: light-dark(var(--red));
}

.note {
    display: flex;
    padding: 16px;
    box-sizing: border-box;
    border-radius: var(--corner-radius);
    border: 1px solid light-dark(var(--subtle));
    color: light-dark(var(--muted));
    font-style: italic;
}