html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
}

main {
    overflow: auto; 
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    background-color: white !important;
    box-shadow: 0 0 0px 1000px white inset !important;
    -webkit-box-shadow: 0 0 0px 1000px white inset !important;
    color: #000 !important;
}

.navbar-brand {
    font-size: 28px !important;
    color: #273b34;
}

.shadow-md {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
}

.form-container {
    display: flex;
    flex-direction: column; /* stack vertically */
    gap: 1rem;
    max-width: 860px; 
    margin: auto; 
    padding: 1rem;
    align-items: center;
}

.form-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .form-row {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        margin-bottom: 0.5rem;
    }

        .form-row label {
            flex: 0 0 120px; 
            text-align: left;
        }

        .form-row input,
        .form-row input[type="number"] {
            max-width: 500px;
            width: 100%;
            box-sizing: border-box;
        }

            .form-row textarea {
                max-width: 600px;
                width: 100%;
                box-sizing: border-box;
            }

    @media (max-width: 600px) {
        .form-row input,
        .form-row textarea,
        .form-row input[type="number"] {
            max-width: 100%; /* allow input to scale down on smaller screens */
        }
    }

    .form-row select {
        padding: 0.4rem;
        font-size: 1rem;
        min-width: 250px;
        border: 1px solid #ced4da;
        max-width: 500px;
    }
}

.form-block {
    width: 100%;
    max-width: 500px; 
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row.text-center {
    display: flex;
    justify-content: center;
}

input, textarea {
    padding: 0.5rem;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ced4da;
    border-radius: .3125rem;
    background-color: #fff;
}

button {
    padding: 0.75rem;
    font-size: 1rem;
    cursor: pointer;
    background-color: #273b34;
    color: #fff;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.page-title {
    margin: 0;
}

.user-menu {
    position: relative;
    cursor: pointer;
}

.user-name {
    font-weight: 500;
    color: #007bff;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 120px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

    .user-dropdown a {
        display: block;
        padding: 8px 12px;
        text-decoration: none;
        color: #333;
    }

        .user-dropdown a:hover {
            background-color: #f5f5f5;
        }

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: flex-start;
}

    .checkbox-grid label {
        display: flex;
        align-items: center;
        font-weight: normal;
        white-space: nowrap;
        padding: 0;
        margin: 0;
        gap: 0.5rem;
        padding: 0.3rem 0.6rem;
        margin: 0.2rem;
    }

    .checkbox-grid input[type="checkbox"] {
        margin: 0;
        padding: 0;
        appearance: auto; 
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

.checkbox-group label {
    display: inline-flex;
    align-items: center;
    margin-right: 1rem; 
    white-space: nowrap; 
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 0.25rem; 
}

.inspection-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* always 2 per row */
    gap: 2rem 0.5rem;
    margin-top: 2rem;
    max-width: 1000px;
    margin: 2rem auto 0;
}

@media (max-width: 1024px) {
    .inspection-container {
        grid-template-columns: 1fr; /* stack on small screens */
    }
}

.inspection-block {
    flex: 1 1 calc(50% - 1rem);
    box-sizing: border-box;
    padding: 1rem;
    border-radius: 6px;
    background-color: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (max-width: 768px) {
    .inspection-block {
        flex: 1 1 100%; /* full width on smaller screens */
    }
}

.inspection-top {
   /* margin-bottom: 0.5rem;*/
}

.inspection-image-wrapper {
    height: 220px; 
    width: 420px; 
    min-width: 100px; /* optional: prevent collapsing too small */
    max-width: 100%; /* optional: keep responsive */
    background-color: #fff;
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 1rem; 
    overflow: hidden;
}

.inspection-img {
    height: 200px;
    width: auto;
    object-fit: contain;
    max-width: 100%;
    display: block;
}

.inspection-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 0.2rem;
    flex-wrap: wrap;
}

.inspection-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.inspection-name {
    font-weight: bold;
    white-space: nowrap;
    margin-right: 1rem;
    margin-bottom: 0.7rem;
}

.inspection-checkboxes {
    display: flex;
    flex-direction: row; 
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

    .inspection-checkboxes label {
        display: flex;
        align-items: center;
        gap: 0.3rem;
        font-size: 1rem;
    }

    .inspection-checkboxes input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

.input-group-vertical {
    display: flex;
    flex-direction: column;
    width: 100%;
}

    .input-group-vertical .text-danger {
        margin-top: 0.25rem;
        font-size: 0.9rem;
        color: red;
    }

.hidden {
    display: none !important;
}

/*.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050; 
}
*/

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(200, 200, 200, 0.4); /* light grey with more transparency */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
}

.d-none {
    display: none !important;
}
