@font-face {
    font-family: "IRANYekan";
    src: url("../assets/fonts/iranyekan/IRANYekanRegular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "IRANYekan";
    src: url("../assets/fonts/iranyekan/IRANYekanMedium.ttf") format("truetype");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "IRANYekan";
    src: url("../assets/fonts/iranyekan/IRANYekanBold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

:root {
    --bs-font-sans-serif: "IRANYekan", sans-serif;
    --bs-body-font-family: "IRANYekan", sans-serif;
    --bs-btn-font-family: "IRANYekan", sans-serif;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
button,
input,
select,
textarea {
    font-family: "IRANYekan", sans-serif;
}

.brand-symbol-light,
.brand-symbol-dark {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.brand-symbol-dark {
    display: none;
}

@media (max-width: 420px) {
    .brand-symbol-light,
    .brand-symbol-dark {
        width: 48px;
        height: 48px;
    }
}

.btn {
    --bs-btn-font-family: "IRANYekan", sans-serif;
}

#mainNav .navbar-brand,
#mainNav .navbar-nav .nav-link,
#portfolio .project-category {
    font-family: "IRANYekan", sans-serif;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    background-color: #101b2c;
    color: #f0f2f5;
    --bs-body-color: #f0f2f5;
    --bs-body-color-rgb: 240, 242, 245;
    --bs-body-bg: #101b2c;
    --bs-body-bg-rgb: 16, 27, 44;
    --bs-light: #192a43;
    --bs-light-rgb: 25, 42, 67;
    --bs-gray-100: #192a43;
    --bs-gray-200: #223957;
    --bs-gray-300: #355273;
    --bs-border-color: #2a4568;
    --bs-link-color: #a9c7f5;
    --bs-link-hover-color: #c6d9f7;
}

:root[data-theme="dark"] body {
    background-color: #101b2c !important;
    color: #f0f2f5;
}

:root[data-theme="dark"] .price-group-title {
    color: #afc8ed;
}

:root[data-theme="dark"] body.inner-page {
    background: #101b2c !important;
}

:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4,
:root[data-theme="dark"] h5,
:root[data-theme="dark"] h6 {
    color: #f0f2f5;
}

:root[data-theme="dark"] .btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #ed1b35;
    --bs-btn-border-color: #ed1b35;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #c9182d;
    --bs-btn-hover-border-color: #c9182d;
    --bs-btn-active-bg: #b81428;
    --bs-btn-active-border-color: #b81428;
    --bs-btn-disabled-bg: #ed1b35;
    --bs-btn-disabled-border-color: #ed1b35;
}

:root[data-theme="dark"] .btn-danger {
    --bs-btn-color: #fff;
}

:root[data-theme="dark"] a:not(.btn) {
    color: #a9c7f5;
}

:root[data-theme="dark"] #mainNav,
:root[data-theme="dark"] body.inner-page #mainNav,
:root[data-theme="dark"] body.home-page #mainNav {
    border-bottom: 1px solid #2a4568;
    background-color: #101b2c;
}

:root[data-theme="dark"] #mainNav .brand-wordmark {
    filter: brightness(0) invert(1);
}

#mainNav .navbar-brand {
    border-bottom: 0;
    text-decoration: none;
}

#mainNav .navbar-toggler {
    width: 3.5rem;
    height: 2.75rem;
    padding: 0;
}

#mainNav .navbar-toggler-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
    margin: 0;
    background-position: center;
}

@media (min-width: 992px) {
    #mainNav .navbar-toggler {
        display: none;
    }
}

#mainNav .navbar-nav {
    align-items: center;
    gap: 0.5rem;
}

#mainNav .navbar-nav .nav-item .nav-link {
    min-width: 7.5rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid #d5deed;
    border-radius: 0.65rem;
    background: #f7f9fc;
    text-align: center;
    transition: color 180ms ease, background-color 180ms ease,
        border-color 180ms ease, box-shadow 180ms ease;
}

#mainNav .navbar-nav .nav-item:last-child .nav-link {
    padding-right: 0.85rem;
    padding-left: 0.85rem;
}

#mainNav .navbar-nav .nav-item .nav-link:hover,
#mainNav .navbar-nav .nav-item .nav-link:focus-visible {
    border-color: #ed1b35;
    background: #fff;
    box-shadow: 0 0.2rem 0.55rem rgba(18, 56, 133, 0.1);
}

#mainNav .navbar-nav .nav-item .nav-link.active {
    border-color: #ed1b35;
    background: #fff5f6;
}

:root[data-theme="dark"] #mainNav .navbar-nav .nav-item .nav-link {
    border-color: #355273;
    background: #192a43;
}

:root[data-theme="dark"] #mainNav .navbar-nav .nav-item .nav-link:hover,
:root[data-theme="dark"] #mainNav .navbar-nav .nav-item .nav-link:focus-visible,
:root[data-theme="dark"] #mainNav .navbar-nav .nav-item .nav-link.active {
    border-color: #ed1b35;
    background: #25364e;
}

#mainNav .theme-toggle {
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 auto;
    margin-inline-start: 0.4rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #123885;
}

#mainNav .theme-toggle:hover,
#mainNav .theme-toggle:focus-visible {
    background: #fff0f2;
}

#mainNav .theme-toggle svg {
    top: 50%;
    right: auto;
    left: 50%;
    width: 1.35rem;
    height: 1.35rem;
    transform: translate(-50%, -50%);
}

#mainNav .theme-toggle .sun-icon {
    left: 50%;
}

#mainNav .theme-toggle .moon-icon {
    right: auto;
    left: 50%;
}

#mainNav .theme-toggle::before {
    display: none;
}

:root[data-theme="dark"] #mainNav .theme-toggle {
    border: 0;
    background: transparent;
    color: #afc8ed;
}

:root[data-theme="dark"] #mainNav .theme-toggle:hover,
:root[data-theme="dark"] #mainNav .theme-toggle:focus-visible {
    background: #25364e;
}

@media (max-width: 991.98px) {
    #mainNav .navbar-toggler {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #mainNav .navbar-nav {
        align-items: stretch;
        gap: 0.5rem;
        padding-top: 0.75rem;
    }

    #mainNav .navbar-nav .nav-item .nav-link {
        width: 100%;
    }
}

@media (max-width: 360px) {
    #mainNav > .container {
        padding-right: 0.75rem !important;
        padding-left: 0.75rem !important;
    }

    #mainNav .brand-wordmark {
        width: 110px;
    }
}

hr.divider {
    border: 0;
    background-color: #ed1b35;
    box-shadow: none;
}

:root[data-theme="dark"] #mainNav .brand-symbol {
    display: none;
}

:root[data-theme="dark"] #mainNav .brand-symbol-dark {
    display: block;
}

:root[data-theme="dark"] #mainNav .navbar-brand,
:root[data-theme="dark"] #mainNav .navbar-nav .nav-link,
:root[data-theme="dark"] #mainNav .navbar-toggler {
    color: #afc8ed;
}

.page-hero {
    padding: 2.5rem 1rem 3rem;
    margin-bottom: 2.5rem;
    border-radius: 1rem;
    background: #123885;
    color: #fff;
    text-align: center;
}

.page-hero-compact {
    margin-bottom: 2.5rem;
}

.page-hero-narrow {
    max-width: 1040px;
    margin-right: auto;
    margin-left: auto;
}

.page-hero h1 {
    color: inherit;
}

.page-hero hr.divider {
    width: 3.25rem;
    height: 0.2rem;
    padding: 0;
    border: 0;
    margin: 1.5rem auto;
    background: #ed1b35;
    opacity: 1;
}

.page-hero p {
    max-width: 680px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.9;
}

:root[data-theme="dark"] .page-hero {
    background: #192a43;
    color: #afc8ed;
}

:root[data-theme="dark"] .page-hero h1 {
    color: inherit;
}

:root[data-theme="dark"] .page-hero p {
    color: #c0d0e7;
}

:root[data-theme="dark"] body.inner-page #mainNav .navbar-nav .nav-item .nav-link,
:root[data-theme="dark"] body.home-page #mainNav .navbar-nav .nav-item .nav-link {
    color: #afc8ed;
}

:root[data-theme="dark"] body.inner-page #mainNav .navbar-nav .nav-item .nav-link:hover,
:root[data-theme="dark"] body.inner-page #mainNav .navbar-nav .nav-item .nav-link:focus,
:root[data-theme="dark"] body.home-page #mainNav .navbar-nav .nav-item .nav-link:hover,
:root[data-theme="dark"] body.home-page #mainNav .navbar-nav .nav-item .nav-link:focus {
    color: #ff8291;
}

:root[data-theme="dark"] #mainNav .navbar-toggler {
    border-color: #355273;
}

:root[data-theme="dark"] #mainNav .navbar-toggler-icon {
    filter: invert(1);
}

:root[data-theme="dark"] .bg-light,
:root[data-theme="dark"] footer {
    background-color: #192a43 !important;
    color: #f0f2f5;
}

:root[data-theme="dark"] footer a,
:root[data-theme="dark"] footer h1,
:root[data-theme="dark"] footer h2,
:root[data-theme="dark"] footer h3 {
    color: #afc8ed;
}

:root[data-theme="dark"] .text-muted,
:root[data-theme="dark"] .small.text-muted {
    color: #d3dae5 !important;
}

:root[data-theme="dark"] .about-placeholder,
:root[data-theme="dark"] .vehicle-category,
:root[data-theme="dark"] .vehicle-option,
:root[data-theme="dark"] .catalog-card,
:root[data-theme="dark"] .price-section,
:root[data-theme="dark"] .finance-section,
:root[data-theme="dark"] .registration-form,
:root[data-theme="dark"] .catalog-tip {
    border-color: #2a4568;
    background-color: #192a43;
    color: #f0f2f5;
}

:root[data-theme="dark"] .vehicle-category {
    border-right-color: #ed1b35;
}

:root[data-theme="dark"] .catalog-card {
    border-top-color: #ed1b35;
}

:root[data-theme="dark"] .about-content .about-placeholder {
    border-color: #ed1b35;
    background: #192a43 !important;
    color: #f0f2f5;
}

:root[data-theme="dark"] .price-group-title {
    color: #f0f2f5;
}

:root[data-theme="dark"] .about-content h1,
:root[data-theme="dark"] .about-content h2 {
    color: #f0f2f5;
}

:root[data-theme="dark"] .registration-form {
    border-color: #2a4568;
    background-color: #192a43;
}

:root[data-theme="dark"] .vehicle-option {
    border-color: #355273;
    background-color: #1b2f4d;
    color: #f0f2f5;
}

:root[data-theme="dark"] .vehicle-option:has(input:checked) {
    border-color: #ed1b35;
    background-color: #332638;
}

:root[data-theme="dark"] .vehicle-option-name {
    color: #afc8ed;
}

:root[data-theme="dark"] .vehicle-option-detail,
:root[data-theme="dark"] .vehicle-list-status,
:root[data-theme="dark"] .vehicle-capacity-note {
    color: #f0f2f5;
}

:root[data-theme="dark"] .vehicle-category-title {
    color: #afc8ed;
}

:root[data-theme="dark"] .catalog-details p,
:root[data-theme="dark"] .price-note,
:root[data-theme="dark"] .section-heading p {
    color: #f0f2f5;
}

:root[data-theme="dark"] .price-table {
    --bs-table-color: #f0f2f5;
    --bs-table-bg: #192a43;
    --bs-table-border-color: #355273;
    --bs-table-striped-color: #f0f2f5;
}

:root[data-theme="dark"] .price-table tbody td {
    border-color: #355273;
    background: #192a43;
    color: #f0f2f5;
}

:root[data-theme="dark"] .price-table tbody tr:nth-child(even) td:not(.price-category) {
    background: #1d304b;
}

:root[data-theme="dark"] .price-table tbody td.price-brand,
:root[data-theme="dark"] .price-table tbody td.price-trim {
    background: #203957;
}

:root[data-theme="dark"] .price-table tbody td.price-brand,
:root[data-theme="dark"] .price-table tbody td.price-category {
    color: #afc8ed;
}

:root[data-theme="dark"] .price-table tbody td.price-category {
    background: #223957;
}

:root[data-theme="dark"] .price-table a {
    color: #afc8ed;
}

:root[data-theme="dark"] .price-table a:hover,
:root[data-theme="dark"] .price-table a:focus {
    color: #ed1b35;
}

:root[data-theme="dark"] .price-section,
:root[data-theme="dark"] .finance-section {
    border-right-color: #ed1b35;
}

:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select {
    border-color: #355273;
    background-color: #101b2c;
    color: #f0f2f5;
}

:root[data-theme="dark"] .form-control::placeholder {
    color: #aebfda;
}

:root[data-theme="dark"] .form-check-input {
    border-color: #526a89;
    background-color: #101b2c;
}

:root[data-theme="dark"] .form-label,
:root[data-theme="dark"] legend,
:root[data-theme="dark"] .form-check-label {
    color: #f0f2f5;
}

:root[data-theme="dark"] .form-control:focus,
:root[data-theme="dark"] .form-select:focus {
    border-color: #afc8ed;
    background-color: #101b2c;
    color: #fff;
}

:root[data-theme="dark"] .submission-success {
    border-color: #36795b;
    background: #203b30;
    color: #d4f4e3;
}

:root[data-theme="dark"] .btn-secondary,
:root[data-theme="dark"] .btn-secondary.disabled {
    border-color: #355273;
    background-color: #223957;
    color: #ccd9ed;
}

.theme-toggle {
    position: relative;
    width: 3.5rem;
    height: 1.9rem;
    display: inline-block;
    padding: 0;
    border: 1px solid #9aaccd;
    border-radius: 2rem;
    background: #dce6f6;
    color: #123885;
    vertical-align: middle;
    cursor: pointer;
    transition: background-color 250ms ease, border-color 250ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background: #cbd9ef;
}

.theme-toggle:focus-visible {
    outline: 3px solid #ed1b35;
    outline-offset: 2px;
}

.theme-toggle svg {
    position: absolute;
    z-index: 1;
    top: 50%;
    display: block;
    width: 1.1rem;
    height: 1.1rem;
    opacity: 1;
    visibility: visible;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    pointer-events: none;
    transform: translateY(-50%);
}

.theme-toggle .sun-icon {
    left: 0.34rem;
    display: block;
}

.theme-toggle .moon-icon {
    right: 0.34rem;
    display: none;
}

.theme-toggle[data-theme="dark"] {
    border-color: #355273;
    background: #1b2f4d;
    color: #afc8ed;
}

.theme-toggle[data-theme="dark"] .sun-icon {
    display: none;
}

.theme-toggle[data-theme="dark"] .moon-icon {
    display: block;
}

.theme-toggle[data-theme="dark"]:hover,
.theme-toggle[data-theme="dark"]:focus-visible {
    background: #203957;
}

.theme-toggle::before {
    position: absolute;
    top: 0.12rem;
    left: 0.12rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.3);
    content: "";
    transition: transform 350ms cubic-bezier(0.2, 0.8, 0.2, 1),
        background-color 250ms ease;
}

.theme-toggle[data-theme="dark"]::before {
    background: #101b2c;
    transform: translateX(1.6rem);
}

:root.theme-changing,
:root.theme-changing body,
:root.theme-changing body *,
:root.theme-changing body *::before,
:root.theme-changing body *::after {
    transition-property: color, background-color, border-color, fill, stroke;
    transition-duration: 350ms;
    transition-timing-function: ease-in-out;
}

::view-transition-old(root) {
    z-index: 1;
    animation: none;
}

::view-transition-new(root) {
    z-index: 2;
    animation: circle-theme-reveal 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.theme-transition-ripple {
    position: fixed;
    z-index: 1029;
    inset: 0;
    pointer-events: none;
    clip-path: circle(0 at var(--theme-origin-x) var(--theme-origin-y));
    opacity: 0.16;
    mix-blend-mode: soft-light;
    animation: circle-theme-reveal 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.theme-ripple-dark {
    background: #123885;
}

.theme-ripple-light {
    background: #ed1b35;
}

@keyframes circle-theme-reveal {
    from {
        clip-path: circle(0 at var(--theme-origin-x) var(--theme-origin-y));
    }

    to {
        clip-path: circle(var(--theme-reveal-radius) at var(--theme-origin-x) var(--theme-origin-y));
    }
}

#adminThemeToggle {
    position: fixed;
    z-index: 1031;
    top: 1rem;
    left: 1rem;
}

:root[data-theme="dark"] main:has(#records) {
    border-color: #2a4568 !important;
    background: #192a43 !important;
    color: #f0f2f5;
}

:root[data-theme="dark"] main:has(#records) h1 {
    color: #afc8ed;
}

:root[data-theme="dark"] main:has(#records) th {
    background: #203957;
    color: #afc8ed;
}

:root[data-theme="dark"] main:has(#records) th,
:root[data-theme="dark"] main:has(#records) td {
    border-color: #355273;
}

:root[data-theme="dark"] main:has(#records) td {
    background: #1d304b;
    color: #f0f2f5;
}

:root[data-theme="dark"] main:has(#records) .notice {
    color: #aebfda;
}

:root[data-theme="dark"] main:has(#records) button {
    background: #244b80;
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    :root.theme-changing,
    :root.theme-changing body,
    :root.theme-changing body *,
    :root.theme-changing body *::before,
    :root.theme-changing body *::after,
    .theme-toggle,
    .theme-toggle::before,
    ::view-transition-new(root) {
        transition-duration: 0.01ms;
        animation-duration: 0.01ms;
    }
    .theme-transition-ripple {
        animation-duration: 0.01ms;
    }
}
