@font-face {
    font-family: 'Nunito';
    src: url('font/font-nunito.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Desktop / larger screens: keep centering */
body {
    font-family: 'Nunito', sans-serif;
    background: #dfdddd;
    /* Center only on sufficiently tall / wide viewports */
    /*display: flex;*/
    display: grid;
    place-items: center;
    margin: 10px;
    padding: 0;
    overflow-x: hidden;
    scroll-behavior: smooth;
    font-size: clamp(14px, 1vh + 0.5vw, 18px);
    min-height: 100svh; /* stable viewport unit (Safari/Chrome support improving) */
    box-sizing: border-box;
}

.logo {
    width: clamp(70px, 10vw, 100px);
    height: auto;
    border-radius: 50%;
}

.index-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 50px rgba(0,0,0,0.50);
    text-align: center;
}

.result-card {
  width: 100%;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 50px rgba(0,0,0,0.50);
  text-align: center;
}

.result-container-item {
  padding: 2%; 
}

.index-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-bottom: 10px;
    object-fit: contain;
}

.text-title {
    color: goldenrod;
}

.text-subtitle {
    color: goldenrod;
    font-weight: bold;
}

.text-label {
    color: #000;
    font-weight: 400;
}

button {
    padding: 12px;
    font-size: 1rem;
    border-radius: 10px;
}

.button-primary {
    color: #000000; 
    background-color: #DCB46B; 
    border-color: #000000; 
}

.button-primary:hover {
    color: #fff;
    background-color: #AE7738; 
    border-color: #000000;
}

/* .button-primary:focus {
    color: #fff;
    background-color: #0056b3;
    border-color: #000000;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); 
}

.button-primary:active {
    color: #fff;
    background-color: #004085; 
    border-color: #000000;
} */

.button-secondary {
    color: #000000; 
    background-color: #fff; 
    border-color: #000000; 
}

.button-secondary:hover {
    color: #fff;
    background-color: #AE7738; 
    border-color: #000000;
}

/* @media (max-height: 600px) {
    body {
    align-items: flex-start;
    padding-top: 40px;
    }
} */

.index-top-container {
    background-image: url(../image/top-banner.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 20px 20px 0 0;
}

.index-top-element {
    padding-top: 5%;
    padding-bottom: 15%;
    padding-left: 5%;
    padding-right: 5%;
}

.index-bottom-container {
    background-image: url(../image/bottom-banner.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 0 0 20px 20px;
}

.index-bottom-element {
    padding-top: 10%;
    padding-bottom: 5%;
    padding-left: 5%;
    padding-right: 5%;
}

.result-top-decoration {
    background-image: url(../image/top-banner.jpg);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
}

.result-top-decoration-item {
    padding-top: 2%;
    padding-bottom: 5%;
    padding-left: 5%;
    padding-right: 5%;
}

.result-bottom-decoration {
    background-image: url(../image/bottom-banner.jpg);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    object-fit: cover;
    border-radius: 0 0 20px 20px;
}

.result-bottom-decoration-item {
    padding-top: 2%;
    padding-bottom: 2%;
    padding-left: 2%;
    padding-right: 2%;
}

.index-form {
    padding: 5%; 
}

.form-control {
    display: block; /* Ensures the element takes up the full width available */
    width: 100%; /* Sets the width to 100% of its parent container */
    padding: 0.375rem 0.75rem; /* Internal spacing around the content */
    /* font-size: 1rem; /* Base font size 
    line-height: 1.5; Line height for text */
    color: #212529; /* Text color */
    background-color: #fff; /* Background color */
    background-clip: padding-box; /* Ensures background only covers padding box */
    border: 1px solid #ced4da; /* Border style and color */
    border-radius: 0.25rem; /* Rounded corners */
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; /* Smooth transitions for focus states */
    -webkit-appearance: none; /* Removes default browser styling for form elements */
    -moz-appearance: none;
    appearance: none;
}

/* Focus state styling */
.form-control:focus {
    color: #212529;
    background-color: #fff;
    border-color: #DCB46B;
    outline: 0;
    box-shadow: 0 0 0 0.25rem #DCB46B;
}

/* Placeholder styling */
.form-control::placeholder {
    color: #000;
    opacity: 1; /* Ensures placeholder text is fully visible */
}

/* Disabled state styling */
.form-control:disabled,
.form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Fit table columns evenly within screen */
    font-size: clamp(14px, 1vh + 0.5vw, 18px);
}

th, td {
    background-color: #DCB46B;
    border: 1px solid #ccc;
    padding: 5px 3px;
    font-size: clamp(14px, 1vh + 0.5vw, 18px);
    text-align: center;
    vertical-align: middle;
    word-wrap: break-word;
    white-space: normal;
}

.custom-table th {
  background-color: #DCB46B;
  color: #1a1d3d;
  font-weight: bold;
  text-align: center;
  border: none;
}

thead {
    background-color: #DCB46B;
    font-weight: 600;
}

@media (min-width: 768px) {
    /* stripe inside trs */ 
    .custom-table tr:nth-of-type(odd) {
        --bs-table-accent-bg: rgba(0, 0, 0, .05);
        color: var(--bs-table-striped-color);
    }
}

@media (max-width: 768px) {

    body {
        /* display: block;           normal flow on mobile */
        padding: 10px 10px 30px;  /* keep some breathing room */
        margin: 0;                /* avoid extra offset */
        min-height: 100dvh;       /* dynamic viewport height to avoid address-bar jumps */
        display: grid;
        place-items: center;
    }

    /* --- Force ONE column for specific td only --- */
    .custom-table td.one-column {
        grid-template-columns: 1fr !important;  /* override 2-column layout */
        text-align: center;
    }

    .custom-table td.one-column::before {
        display: block;        /* label goes on top */
        text-align: center;
        padding-right: 0;
        padding-bottom: 4px;
    }

    /* --- Chrome layout stabilization --- */
    .custom-table {
        contain: layout paint;     /* isolate layout for Chrome */
        transform: translateZ(0);  /* force a repaint layer */
        margin-top: 0;
        padding-top: 0;
    }

    .custom-table thead {
        display: none;
    }

    .custom-table tr {
        display: block;            /* stack rows vertically */
        margin-bottom: 12px;
        border: 1px solid #ddd;
        padding: 10px;
        background-color: #fff;
        scroll-margin-top: 0;      /* avoid mid-scroll jumps */
    }

    .custom-table td {
        display: grid;
        grid-template-columns: 1fr 1fr; /* two-column layout */
        text-align: center;
        padding: 8px 10px;
        font-size: clamp(14px, 1vh + 0.5vw, 18px);
        border: none !important;
        border-bottom: 1px solid #e9ecef !important;
        box-sizing: border-box;
    }

    .custom-table td:last-child {
        border-bottom: none !important;
    }

    .custom-table td::before {
        content: attr(data-label);
        font-weight: bold;
        text-align: center;
        padding-right: 10px;
    }

    .custom-table td.sub-title {
        background-color: #DCB46B;
        font-weight: bold;
    }

    .custom-table td:nth-child(even) { 
        background: #f5f5f5;
    } 
}