/* App stylesheet — consolidates the project-authored overrides that used to
   be split across site.css, style.css, custom.css and an inline <style>
   block in _Layout.cshtml (issue #109 step 3). Order matches the original
   cascade exactly: several rules below only look correct because they load
   after assets/css/connect.min.css (the base theme) and after each other in
   this order — do not reorder sections without checking for the same
   selector elsewhere in this file.

   Brand colors reference the --bb-* tokens defined in css/theme.css
   (issue #109 step 5); var() resolves at computed-value time, so the
   load order between the two files does not matter for these. */

/* ============ Base (formerly site.css) ============ */

a.navbar-brand {
  white-space: normal;
  text-align: center;
  word-break: break-all;
}

/* Provide sufficient contrast against white background */
a {
  color: #0366d6;
}

.btn-primary {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  color: var(--bb-accent-contrast);
  background-color: var(--bb-accent);
  border-color: var(--bb-accent);
}

/* Sticky footer styles
-------------------------------------------------- */
html {
  font-size: 14px;
}
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.border-top {
  border-top: 1px solid #e5e5e5;
}
.border-bottom {
  border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

/* Sticky footer styles
-------------------------------------------------- */
html {
  position: relative;
  min-height: 100%;
}

body {
  /* Margin bottom by footer height */
  margin-bottom: 60px;
}
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px; /* Vertically center the text there */
}

::-ms-reveal {
    display: none;
}

.form-control.invalid,
.form-select.invalid,
textarea.form-control.invalid,
.invalid,
.form-control.input-validation-error,
.form-select.input-validation-error,
textarea.form-control.input-validation-error {
  border-color: #dc3545 !important;
  box-shadow: none !important;
  background-color: #fff !important;
  background-image: none !important;
}

.text-danger {
  color: #dc3545 !important;
}

.field-validation-error,
.field-validation-error span {
  color: #dc3545 !important;
}

.form-control.readonly-field,
textarea.form-control.readonly-field {
  background-color: #e9ecef !important;
  color: #6c757d !important;
}

.form-control.contractor-readonly-field[readonly],
textarea.form-control.contractor-readonly-field[readonly] {
  color: #212529 !important;
  background-color: #fff !important;
  border-color: #ced4da !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #212529 !important;
}

#divParterEpostFormat,
#divParterEpost2Format,
#divHantverkareEpostFormat,
#divParterPersonnummerFormat,
#divParter2PersonnummerFormat,
#divHantverkarePersonnummerFormat {
  color: #dc3545 !important;
}

/* ============ Legacy skin (formerly style.css) ============ */

body {
    background-color: #F0EDE6;
}

h1 {
    text-align: center;
}

table a {
    color: var(--bb-accent) !important;
}

input {
    padding: 10px;
    width: 100%;
    font-size: 17px;
    border: 1px solid #aaaaaa;
}
    /* Mark input boxes that get an error on validation: */
    input.invalid {
        background-color: #ffdddd;
    }

select.invalid {
    background-color: #ffdddd;
}
/* Hide all steps by default: */
.tab {
    display: none;
}

button {
    background-color: var(--bb-accent);
    color: var(--bb-accent-contrast);
    border: none;
    padding: 10px 20px;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.3s ease 0s;
}

    button:hover {
        opacity: 0.8;
    }

#prevBtn {
    background-color: #bbbbbb !important;
}
#nextBtn {
    background-color: var(--bb-accent) !important;
}
/* Steps for form */
.step {
    height: 15px;
    width: 15px;
    margin: 0 2px;
    background-color: #bbbbbb;
    border: none;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.5;
}

    .step.active {
        opacity: 1;
    }

    .step.finish {
        background-color: var(--bb-accent);
    }
/* Input field adjustments for spin buttons */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}
/* Icons in fields */
.field-icon {
    float: right;
    margin-right: 25px;
    margin-top: -28px;
    position: relative;
    z-index: 2;
}
/* Auth page specific styles */
.auth-page.sign-in .auth-image {
    background: url("/image/2.jpg") center center no-repeat !important;
    background-size: 100% 100%;
}

.auth-page .logo-box a {
    font-size: 55px !important;
}
/* Custom font-face */
@font-face {
    font-family: "Montserrat-Light-Alt1";
    src: url("/Montserrat-Light-Alt1.woff2") format("woff2") !important;
}

@font-face {
    font-family: "Montserrat-Light-Alt1";
    src: url("/Montserrat-Light-Alt1.ttf") format("truetype") !important;
}

.page-container {
    width: 95% !important;
}

.page-content {
    padding: 0 0px;
}

.page-sidebar {
    width: 280px;
    position: fixed;
    background-color: #F0EDE6;
    top: 0;
    bottom: 0;
    padding: 30px;
    box-shadow: 0 0 1.25rem rgb(31 45 61 / 4%);
    transition: background .2s ease-in-out;
}

.accordion-menu li.active-page > a,
.accordion-menu li > a:hover {
    color: #29432D;
    background: rgba(0, 0, 0, .01);
}

    .accordion-menu li.active-page > a:only-child {
        background: var(--bb-accent);
        color: var(--bb-accent-contrast);
    }

/*Home view*/
.home-page .page-content {
    padding: 0 0px;
    background-color: #f0ede6;
}

.home-page .accordion {
    background-color: #eee;
    color: #444;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 15px;
    transition: 0.4s;
}

    .home-page .active, .home-page .accordion:hover {
        background-color: #ccc;
    }

    .home-page .accordion:after {
        content: '\002B';
        color: #777;
        font-weight: bold;
        float: right;
        margin-left: 5px;
    }

.home-page .active:after {
    content: "\2212";
}

.home-page .panel {
    padding: 0 18px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    width: 100%;
    transition: max-height 0.2s ease-out;
}

.home-page .mainpanel {
    padding: 40px;
}
/*Project view*/
.project-page .project-contract input.invalid {
    background-color: #fdd;
}

.project-page .project-contract .selectedBorder {
    border: 1px solid #c5975e !important;
}

.project-page .project-contract .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' d='M8 0a1 1 0 0 1 1 1v6h6a1 1 0 1 1 0 2H9v6a1 1 0 1 1-2 0V9H1a1 1 0 0 1 0-2h6V1a1 1 0 0 1 1-1z' clip-rule='evenodd'/%3e%3c/svg%3e");
    transform: scale(0.7) !important;
}

.project-page .project-contract .accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' d='M0 8a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H1a1 1 0 0 1-1-1z' clip-rule='evenodd'/%3e%3c/svg%3e");
}

.project-page .project-contract .accordion-button:not(.collapsed) {
    color: #0c63e4;
    background-color: #fff;
    box-shadow: inset 0 -1px 0 #000;
}

.project-page .project-contract .datetest {
    position: relative;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    border: 2px solid #e8e8e8;
    font-size: 17px;
    font-weight: 700;
    color: #5c6662;
}

    .project-page .project-contract .datetest:before {
        position: absolute;
        top: 6px;
        left: 20px;
        right: 20px;
        content: attr(data-date);
        display: inline-block;
        color: black;
    }

    .project-page .project-contract .datetest::-webkit-datetime-edit, .project-page .project-contract input::-webkit-inner-spin-button, .project-page .project-contract input::-webkit-clear-button {
        display: none;
    }

    .project-page .project-contract .datetest::-webkit-calendar-picker-indicator {
        position: absolute;
        top: 3px;
        right: 0;
        color: black;
        opacity: 1;
    }

.project-page .project-contract textarea.invalid {
    background-color: #fdd;
}

.project-page .project-contract .accordion-menu li.active-page > a:only-child {
    background: var(--bb-accent);
    color: var(--bb-accent-contrast);
}

.project-page .project-contract .toast-container > div {
    position: relative;
    pointer-events: auto;
    overflow: hidden;
    margin: 0 0 6px;
    padding: 15px 15px 15px 50px;
    width: 300px;
    -moz-border-radius: 3px 3px 3px 3px;
    -webkit-border-radius: 3px 3px 3px 3px;
    border-radius: 3px 3px 3px 3px;
    background-position: 15px center;
    background-repeat: no-repeat;
    -moz-box-shadow: 0 0 12px #999;
    -webkit-box-shadow: 0 0 12px #999;
    box-shadow: 0 0 12px #999;
    color: black;
    opacity: 0.8;
    -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
    filter: alpha(opacity=80);
}

.project-page .project-list .page-content {
    padding: 0 0px;
}


.project-page .project-list .accordion-menu li.active-page > a:only-child {
    background: var(--bb-accent);
    color: var(--bb-accent-contrast);
}

.project-page .project-list .divider {
    display: block;
    content: '';
    width: 100%;
    height: 1px;
    background: #e8e8e8;
    margin: 10px 0;
}

.project-page .project-list .mail-actions {
    margin-top: auto;
    text-align: right;
    margin-bottom: 50px;
}

.project-page .project-list .mailbox-item {
    display: block;
    position: fixed;
    height: calc(100vh - 60px);
    width: 850px;
    background: #fff;
    right: 0;
    z-index: 99;
    box-shadow: 0 0 1.25rem #000;
    padding: 45px;
    transform: translateX(100%);
    -webkit-transition: all 0.2s ease-in-out;
    -moz-transition: all 0.2s ease-in-out;
    -o-transition: all 0.2s ease-in-out;
    transition: all 0.2s ease-in-out;
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
    margin: 30px 0;
    overflow-y: scroll;
}

@media screen and (max-width: 768px) {
    .project-page .project-list .modal {
        margin: 15px;
        width: 90%;
    }
}
/*Invoice view*/
.invoice-page .invoice-list .page-content {
    padding: 0 0px;
}

.invoice-page .invoice-list .accordion-menu li.active-page > a:only-child {
    background: var(--bb-accent);
    color: var(--bb-accent-contrast);
}

.invoice-page .invoice-list .divider {
    display: block;
    content: '';
    width: 100%;
    height: 1px;
    background: #e8e8e8;
    margin: 10px 0;
}

.invoice-page .invoice-list .mail-actions {
    margin-top: auto;
    text-align: right;
    margin-bottom: 50px;
}

.invoice-page .invoice-list .mailbox-item {
    display: block;
    position: fixed;
    height: calc(100vh - 60px);
    width: 850px;
    background: #fff;
    right: 0;
    z-index: 99;
    box-shadow: 0 0 1.25rem #000;
    padding: 45px;
    transform: translateX(100%);
    -webkit-transition: all 0.2s ease-in-out;
    -moz-transition: all 0.2s ease-in-out;
    -o-transition: all 0.2s ease-in-out;
    transition: all 0.2s ease-in-out;
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
    margin: 30px 0;
    overflow-y: scroll;
}

.invoice-page .invoice-list ::-webkit-scrollbar {
    width: 10px;
    height: 6px;
    background-color: transparent;
    margin: 4px;
}

.invoice-page .invoice-list ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.225);
    border-radius: 5px;
    margin: 4px;
    padding-right: 6px;
}

.invoice-page .invoice-list ::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background-color: #9e9e9e d4;
    margin: 4px;
}

.invoice-page .invoice-list .row > div {
    overflow-x: auto;
    padding-left: 5px;
    padding-top: 5px;
}

.invoice-page .invoice-list label a {
    text-decoration: none !important;
}

.invoice-page .invoice-create input.invalid {
    background-color: #fdd;
}

.invoice-page .invoice-create .selectedBorder {
    border: 1px solid #c5975e !important;
}

.invoice-page .invoice-create .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' d='M8 0a1 1 0 0 1 1 1v6h6a1 1 0 1 1 0 2H9v6a1 1 0 1 1-2 0V9H1a1 1 0 0 1 0-2h6V1a1 1 0 0 1 1-1z' clip-rule='evenodd'/%3e%3c/svg%3e");
    transform: scale(0.7) !important;
}

.invoice-page .invoice-create .accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' d='M0 8a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H1a1 1 0 0 1-1-1z' clip-rule='evenodd'/%3e%3c/svg%3e");
}

.invoice-page .invoice-create .accordion-button:not(.collapsed) {
    color: #0c63e4;
    background-color: #fff;
    box-shadow: inset 0 -1px 0 #000;
}

.invoice-page .invoice-create .datetest {
    position: relative;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    border: 2px solid #e8e8e8;
    font-size: 17px;
    font-weight: 700;
    color: #5c6662;
}

    .invoice-page .invoice-create .datetest:before {
        position: absolute;
        top: 6px;
        left: 20px;
        right: 20px;
        content: attr(data-date);
        display: inline-block;
        color: black;
    }

    .invoice-page .invoice-create .datetest::-webkit-datetime-edit, .invoice-page .invoice-create input::-webkit-inner-spin-button, .invoice-page .invoice-create input::-webkit-clear-button {
        display: none;
    }

    .invoice-page .invoice-create .datetest::-webkit-calendar-picker-indicator {
        position: absolute;
        top: 3px;
        right: 0;
        color: black;
        opacity: 1;
    }

.invoice-page .invoice-create textarea.invalid {
    background-color: #fdd;
}

.invoice-page .invoice-create .accordion-menu li.active-page > a:only-child {
    background: var(--bb-accent);
    color: var(--bb-accent-contrast);
}

/* ============ Custom overrides (formerly custom.css) ============ */

.auth-page.sign-in .auth-image {
    background: url('https://images.unsplash.com/photo-1509453721491-c3af5961df76?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=800&q=60') center center no-repeat !important;
    background-size: 90% 70%;
}

body {
    background-color: white;
}

.auth-image {
    background-image: none;
}

.logo-box a.logo-text {
    color: black;
    text-transform: none !important;
}

.btn.btn-primary {
    color: var(--bb-accent-contrast);
    background: var(--bb-accent);
}

.btn-primary:before {
    background: var(--bb-accent-hover);
}

a {
    color: black;
}

.authentication a {
    color: var(--bb-accent) !important;
}

@media screen and (max-width: 1000px) {
    .auth-page .auth-form {
        padding-left: 0px;
        padding-right: 0px;
    }
}

/* ============ Validation error override (formerly inline in _Layout.cshtml) ============
   Must stay last in this file — it needs to win over the site.css-derived
   .form-control.invalid rule above (same specificity, source order decides).
   The var(--bs-body-bg) background makes it follow light/dark theme
   automatically; theme.css additionally overrides border/background again
   under [data-bs-theme="dark"] with higher specificity for the dark palette. */

.form-control.invalid,
.form-select.invalid,
textarea.form-control.invalid,
.form-control.input-validation-error,
.form-select.input-validation-error,
textarea.form-control.input-validation-error {
    border-color: #dc3545 !important;
    box-shadow: none !important;
    background-color: var(--bs-body-bg) !important;
    background-image: none !important;
}
