/* GLOBAL */

html {
    overflow-y: scroll;
}

body {
    background-image:
            linear-gradient(rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.32)),
            url('/images/background.jpg');
    background-size: cover;
    background-position: left center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', Arial, sans-serif;
    font-weight: 400;

    color: #000;

    display: flex;
    justify-content: center;
    align-items: flex-start;
}

h1, h2, h3 {
    font-weight: 600;
}

p, label, input, button, a, td, th {
    font-weight: 400;
}

label {
    font-weight: 600;
}

select,
input {
    padding: 12px;
    font-size: 16px;
    border: 1px solid #b5b5b5;
    border-radius: 8px;
}

button {
    margin-top: 20px;
    padding: 14px;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;

    background-color: #004b8d;
    color: white;

    border: none;
    border-radius: 8px;
}

button:hover {
    background-color: #00386a;
}


/* HEADER */

.site-header {
    position: fixed;
    top: 35px;
    left: 0;
    right: 30px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    z-index: 1000;
}

.site-logo {
    width: 170px;
    height: auto;
    display: block;
}

.top-buttons {
    display: flex;
    gap: 10px;
}

.top-buttons a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    text-decoration: none;
    border-radius: 7px;
    font-size: 0.95rem;
    font-weight: 600;
}

.login-btn {
    background-color: white;
    color: #004b8d;
    border: 1px solid #cfd6dd;
}

.login-btn:hover {
    background-color: #f7f7f7;
    border-color: #00386a;
}

.create-user-btn {
    background-color: #004b8d;
    color: white;
    border: 1px solid #004b8d;
}

.create-user-btn:hover {
    background-color: #00386a;
    border-color: #00386a;
}

.logout-btn,
.offer-buttons a {
    padding: 8px 14px;
    background-color: #2c2c2c;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
}


/* SHARED FORM BOX */

.form-box {
    width: 350px;
    padding: 60px;

    background-color: #ffffff;
    border: 1px solid #d8e3ee;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);

    border-radius: 10px;
}

.form-box h1 {
    font-size: 40px;
    font-weight: 500;
    line-height: 1.1;

    margin-top: 0;
    margin-bottom: 20px;

    text-align: center;
}


/* CARPORT FORM */

.carport-form {
    width: 300px;
    margin: 0 auto;

    display: flex;
    flex-direction: column;
    gap: 5px;
}

.carport-form input,
.carport-form button {
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 10px rgba(0, 75, 141, 0.25);
}

.carport-form button {
    margin-top: 0;
}

.carport-form button:hover {
    background-color: #003f78;
}

.carport-form input:hover {
    border-color: #00589c;
}

.carport-form input:focus {
    outline: none;
    border-color: #00589c;
    box-shadow: 0 0 0 3px rgba(0, 88, 156, 0.15);
}


/* FRONTPAGE */

.frontpage-form {
    margin-top: 150px;
    padding-top: 30px;
}

.carport-img {
    display: block;
    margin: 0 auto;

    width: 200px;
    height: auto;
}

.form-subtitle {
    width: 300px;
    margin: 0 auto 100px auto;

    text-align: center;
    font-size: 20px;
}

.input-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;

    position: relative;
    top: -50px;
}

.width-label {
    margin-top: 14px;
}

.form-divider {
    width: 300px;
    height: 1px;
    margin: -60px auto 80px auto;

    background-color: #c8cdd3;
}

.offer-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;

    position: relative;
    padding: 16px 24px;
}

.offer-submit-btn .fa-arrow-right {
    position: absolute;
    right: 24px;
}


/* LOGIN PAGE */

.login-form {
    position: relative;
    margin-top: 150px;
}

.login-form input:hover {
    border-color: #00589c;
}

.login-form input:focus {
    outline: none;
    border-color: #00589c;
    box-shadow: 0 0 0 3px rgba(0, 88, 156, 0.15);
}

.login-avatar {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 60px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    font-size: 30px;

    background-color: #004b8d;
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;
}

.login-subtitle {
    width: 300px;
    margin: 0 auto 35px auto;

    text-align: center;
    font-size: 18px;
    line-height: 1.4;
    color: #333;
}

.login-fields {
    width: 300px;
    margin: 50px auto 0 auto;

    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-input {
    position: relative;
    width: 100%;

    display: flex;
    align-items: center;
}

.login-input input {
    width: 100%;
    box-sizing: border-box;

    padding-left: 50px;
    padding-right: 50px;

    box-shadow: 0 4px 10px rgba(0, 75, 141, 0.25);
}

.login-input input:focus {
    outline: none;
    border-color: #00589c;
    box-shadow: 0 0 0 3px rgba(0, 88, 156, 0.15);
}

.login-input > i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);

    color: #6f879c;
    font-size: 18px;
    line-height: 1;
}

.toggle-password {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);

    width: 24px;
    height: 24px;

    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: none;
    box-shadow: none;
    color: #6f879c;
}

.toggle-password i {
    font-size: 18px;
    line-height: 1;
    color: #6f879c;
}

.toggle-password:hover {
    background: transparent;
}

.login-submit-btn {
    width: 100%;
    box-sizing: border-box;

    margin-top: 40px;

    box-shadow: 0 4px 10px rgba(0, 75, 141, 0.25);
}

.login-submit-btn:hover {
    background-color: #003f78;
}


/* CREATE USER PAGE */

.create-user-box {
    position: relative;
    width: 350px;
    margin-top: 100px;
}

.create-user-box h1 {
    font-size: 34px;
    font-weight: 500;
    margin: 0 0 10px 0;
}

.create-user-avatar {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 60px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    font-size: 30px;

    background-color: #004b8d;
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;
}

.create-user-header {
    text-align: center;
    margin-bottom: 35px;
}

.create-user-header p {
    margin: 0;
    font-size: 17px;
    color: #333;
}

.create-user-form {
    width: 300px;
    margin: 50px auto 0 auto;

    display: flex;
    flex-direction: column;
    gap: 28px;
}

.create-user-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.create-user-section h2 {
    text-align: center;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #004b8d;
}

.create-user-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.create-user-field input {
    width: 100%;
    box-sizing: border-box;

    box-shadow: 0 4px 10px rgba(0, 75, 141, 0.25);
}

.create-user-field input:hover {
    border-color: #00589c;
}

.create-user-field input:focus {
    outline: none;
    border-color: #00589c;
    box-shadow: 0 0 0 3px rgba(0, 88, 156, 0.15);
}

.create-user-form > button {
    width: 100%;
    box-sizing: border-box;

    margin-top: 12px;

    box-shadow: 0 4px 10px rgba(0, 75, 141, 0.25);
}

.create-user-form > button:hover {
    background-color: #003f78;
}


/* OFFER PAGE */

.offer-page-box {
    margin-top: 200px;
    text-align: center;
}

.offer-drawing {
    width: 360px;
    margin: 0 auto 20px auto;

    display: flex;
    justify-content: center;
    transform: translateX(-15px);
}

.offer-drawing svg {
    width: 100%;
    height: auto;
    display: block;
}

.offer-buttons {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 15px;
}

.offer-buttons a {
    font-weight: 600;
    font-size: 16px;
}

.offer-buttons a:last-child {
    background-color: #004b8d;
    color: white;
    border: 1px solid #004b8d;
}

.offer-buttons a:first-child:hover {
    background-color: #f7f7f7;
    border-color: #00386a;
}

.offer-buttons a:first-child {
    background-color: white;
    color: #004b8d;
    border: 1px solid #cfd6dd;
}

.offer-buttons a:last-child:hover {
    background-color: #00386a;
}


/* USER PAGE */

.user-page {
    padding-top: 100px;
}

.user-offer-drawing {
    width: 360px;
    margin: 25px auto 25px auto;
}

.user-offer-drawing svg {
    width: 100%;
    height: auto;
    display: block;
}

.user-top-right {
    position: fixed;
    top: 20px;
    right: 30px;

    display: flex;
    align-items: center;
    gap: 14px;

    z-index: 1000;
}

.user-top-right span {
    color: #334155;
    font-size: 0.95rem;
}

.user-offer-form {
    background-color: #ffffff;
    border: 1px solid #d8e3ee;
    border-radius: 10px;
    padding: 0 30px 30px 30px;

    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}

.user-offer-form h2 {
    width: 300px;
    margin-left: auto;
    margin-right: auto;

    text-align: left;
}

.user-offer-form .carport-form input,
.user-offer-form .carport-form button {
    width: 100%;
    box-sizing: border-box;
}

.user-offer-form .carport-form button {
    margin-top: 18px;
}

.user-section {
    background-color: #ffffff;
    border: 1px solid #d8e3ee;
    border-radius: 10px;
    padding: 0 30px 30px 30px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}

.user-offer-card,
.user-order-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 2px solid #c9d5e2;
    padding-bottom: 18px;
    margin-bottom: 16px;
}

.user-offer-card span,
.user-order-card span {
    white-space: nowrap;
}

.user-offer-card form,
.user-order-card form {
    margin: 0;
}

.user-offer-card button,
.user-order-card button {
    margin: 0;
    padding: 0 14px;
    height: 38px;

    font-size: 0.82rem;
    font-weight: 600;

    width: auto;
    white-space: nowrap;
}

.user-card-buttons {
    display: flex;
    width: 100%;
    gap: 8px;
    margin-top: 14px;
}

.user-card-buttons .reject-btn {
    margin-right: auto;
}

.reject-btn {
    background-color: #b22222;
}

.reject-btn:hover {
    background-color: #8b1a1a;
}

.accept-btn {
    background-color: #228b22;
}

.accept-btn:hover {
    background-color: #1a6e1a;
}

.user-page input[type="radio"] {
    display: none;
}

.user-tabs {
    width: 550px;
    display: flex;
    gap: 20px;
    margin: 40px auto 0 auto;
}

.user-tabs label {
    width: 170px;
    box-sizing: border-box;
    padding: 16px 28px;

    background: #edf3f8;
    border: 1px solid #d8e3ee;
    border-bottom: none;
    border-radius: 10px 10px 0 0;

    font-weight: 600;
    cursor: pointer;

    transition: 0.18s ease;
}

.user-panel {
    display: none;
    width: 550px;
    box-sizing: border-box;
    margin: -1px auto 0 auto;

    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

#user-create-tab:checked ~ .user-create-panel {
    display: block;
}

#user-offers-tab:checked ~ .user-offers-panel {
    display: block;
}

#user-orders-tab:checked ~ .user-orders-panel {
    display: block;
}

#user-create-tab:checked ~ .user-tabs label[for="user-create-tab"],
#user-offers-tab:checked ~ .user-tabs label[for="user-offers-tab"],
#user-orders-tab:checked ~ .user-tabs label[for="user-orders-tab"] {
    background: #ffffff;
    border-bottom: 1px solid #ffffff;
}

.user-create-panel h2,
.user-create-panel .offer-subtitle {
    width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.user-offers-panel,
.user-orders-panel {
    padding-top: 30px;
}

.offer-title {
    font-weight: 700;
    font-size: 1.02rem;
}

.user-create-panel .carport-form input:first-of-type {
    margin-bottom: 16px;
}

.user-create-panel .offer-title {
    width: 300px;
    margin-left: auto;
    margin-right: auto;

    text-align: left;
    font-size: 30px;
    font-weight: 500;
    line-height: 1.1;
}

/* ADMIN PAGE */

.admin-container {
    max-width: 1100px;
    margin: 140px auto 40px auto;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.orders-panel {
    display: block;
    width: 100%;
    margin-top: 0;

    border-top-left-radius: 0;
}

.admin-top-right {
    position: fixed;
    top: 20px;
    right: 30px;

    display: flex;
    align-items: center;
    gap: 14px;

    z-index: 1000;
}

.admin-top-right span {
    color: #334155;
    font-size: 0.95rem;
    text-align: right;
}

.admin-section {
    display: none;
    width: 1000px;
    max-width: 1000px;
    box-sizing: border-box;
    margin-bottom: 0;
    padding: 0 30px 30px 30px;

    background-color: #ffffff;
    border: 1px solid #d8e3ee;
    border-radius: 10px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}

#orders-tab:checked ~ .orders-panel {
    display: block;
}

#offers-tab:checked ~ .offers-panel {
    display: block;
}

#customers-tab:checked ~ .customers-panel {
    display: block;
}

.admin-summary {
    display: block;
    position: relative;
    text-align: center;

    padding: 18px 30px;
    margin: -10px -30px;

    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
}

.admin-summary::marker {
    content: "";
}

.admin-summary::-webkit-details-marker {
    display: none;
}

.admin-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
}

.admin-section th,
.admin-section td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #ccc;
}

.price-cell {
    white-space: nowrap;
}

.admin-container input[type="radio"] {
    display: none;
}

.admin-section form {
    margin: 0;
}

.admin-section button {
    margin-top: 0;
    padding: 10px 14px;
    font-size: 0.82rem;
}

.admin-tabs {
    width: 100%;
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

#orders-tab:checked ~ .admin-tabs label[for="orders-tab"],
#offers-tab:checked ~ .admin-tabs label[for="offers-tab"],
#customers-tab:checked ~ .admin-tabs label[for="customers-tab"] {
    background: #ffffff;
    border-bottom: 1px solid #ffffff;
}

.admin-tabs label {
    position: relative;
    z-index: 2;
}

#orders-tab:checked ~ .admin-tabs label[for="orders-tab"] {
    border-bottom: 1px solid #ffffff;
}

.orders-panel,
.offers-panel,
.customers-panel {
    margin-top: -1px;
    border-top-left-radius: 0;
}

.admin-tabs label {
    padding: 16px 28px;

    background: #edf3f8;
    border: 1px solid #d8e3ee;
    border-bottom: none;

    border-radius: 10px 10px 0 0;

    font-weight: 600;
    cursor: pointer;

    transition: 0.18s ease;
}

.admin-tabs label:hover {
    background: #f7fbff;
}

/* BOM MODAL */

.bom-dialog {
    padding: 0;
    border: none;
    border-radius: 12px;

    width: 650px;
    height: auto;
    max-width: 95vw;
    max-height: 90vh;

    overflow: hidden;
}

.bom-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.bom-frame {
    width: 100%;
    height: 100%;
    border: none;
}


/* BOM PAGE */

html:has(body.bom-body) {
    overflow-y: auto;
}

body.bom-body {
    min-height: auto;
    overflow-y: auto;
    display: block;
}

.bom-body {
    background: white;
    margin: 0;
    overflow-y: auto;
}

.bom-body h1 {
    margin-bottom: 45px;
}

.bom-body .form-box {
    margin: 0;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
    padding: 65px 40px 20px 40px;
    position: relative;
    border: none;
}

.bom-top-buttons {
    position: absolute;
    top: 18px;
    right: 18px;

    display: flex;
    gap: 10px;
}

.bom-print-btn,
.bom-close-btn {
    margin: 0;
    padding: 7px 14px;
    font-size: 14px;
    border-radius: 7px;
}

.bom-drawing {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow: visible;
    margin-top: -15px;
}

.bom-drawing svg {
    max-width: none;
    overflow: visible;
    display: block;
}

.bom-body table {
    margin: 0 auto;
    border-collapse: collapse;
    width: auto;
    font-size: 16px;
}

.bom-body table th,
.bom-body table td {
    padding: 3px 7px;
    text-align: left;
}

.bom-meta {
    width: fit-content;
    margin: 0 auto 0 auto;

    display: flex;
    flex-direction: column;
    gap: 10px;

    font-size: 17px;

    padding-bottom: 25px;
}

.bom-body table th {
    padding-bottom: 4px;
    border-bottom: 2px solid #cfcfcf;
    font-weight: 700;
    font-size: 17px;
}

.bom-body table tbody td {
    padding-top: 8px;
}

.bom-body .total-row td {
    padding-top: 14px;
}

.bom-body table th:nth-child(2),
.bom-body table td:nth-child(2),
.bom-body table th:nth-child(3),
.bom-body table td:nth-child(3),
.bom-body table th:nth-child(4),
.bom-body table td:nth-child(4),
.bom-body table th:nth-child(5),
.bom-body table td:nth-child(5) {
    text-align: right;
}

.bom-body .logout-btn {
    display: block;
    width: fit-content;
    margin: 30px auto 0 auto;
    padding: 14px 28px;
    font-size: 18px;
}


/* SUCCESS MODAL */

.success-modal {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0.75);

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 9999;
}

.success-modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 450px;
    text-align: center;
}


/* ACCEPT MODAL */

.accept-dialog {
    border: none;
    border-radius: 12px;
    padding: 30px;
    max-width: 420px;
    text-align: center;
}

.accept-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* ERROR MODAL */

.error-modal {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.error-modal-content {
    min-width: 280px;
    padding: 16px 22px;

    background-color: #ffffff;
    border: 1px solid #d8e3ee;
    border-left: 5px solid #c62828;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);

    text-align: center;
}

.error-modal-content p {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
}

.error-modal-content button {
    padding: 6px 18px;
    border: none;
    border-radius: 6px;
    background-color: #004b8d;
    color: white;
    cursor: pointer;
}