html {
    /* Apply the background here to avoid Safari overscroll issues */
    background-image: url('../img/BG02.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Keep it fixed to the viewport */
    min-height: 100%;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* General Body & Background */
body {
    font-family: 'Noto Sans JP', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif';
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #333;
    overflow-y: auto;
    min-height: 100vh; /* Ensure body takes full viewport height */
    box-sizing: border-box;
}

/* Main content container */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
    flex-grow: 1; /* Allow container to fill vertical space */
}

/* Header and Logo */
header {
    width: 100%;
    text-align: center;
    padding-top: 2rem; /* Add some padding to the top */
    margin-bottom: 20px; /* Remove bottom margin */
}
ul {
  list-style: none;
}

li {
    padding:5px;
}

.logo {
    max-width: 300px; /* Bigger max size for desktop screens */
    width: 80%; /* Scales responsively relative to its container */
    height: auto;
    margin-bottom: 1rem; /* Space between logo and text */
}

.header-text {
    font-size: 1.2rem;
    color: white;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7); /* Keep shadow for readability */
}

main {
    display: flex;
    justify-content: center; /* Center content horizontally */
    width: 100%; /* Take full width of parent */
    flex-grow: 1; /* Allow main to fill space */
}

/* Wrapper for vertically centering content */
.content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    width: 100%;
}

/* Form Styling */
.data-form {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 0; /* Make it rectangular */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
}

/* Form Groups */
.form-group, .form-group-row, .form-group.display-only {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-size: 0.9rem;
    color: #555;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 0; /* Make it square */
    box-sizing: border-box;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Row for side-by-side inputs - now with wrapping */
.form-group-row {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap onto the next line */
    gap: 1rem;
}

.form-group-row .form-group {
    flex: 1 1 150px; /* Grow, Shrink, and Base width of 150px */
    margin-bottom: 0;
}

/* House display field */
.display-only p {
    background-color: #f0f0f0; /* Light gray background */
    padding: 1rem 1.2rem; /* More padding */
    border-radius: 0; /* Make it square */
    margin: 0;
    font-size: 1.1rem; /* Slightly larger font */
    font-weight: 700; /* Bolder font weight */
    color: #0056b3; /* A distinct color for the text */
    text-align: center;
    border: 1px solid #d0d0d0;
}

.display-only-select {
    display: block;              /* ← important */
    width: 100%;                 /* or fixed width */
    margin: 0 auto;
    background-color: #f0f0f0; /* Light gray background */
    padding: 1rem 1.2rem; /* More padding */
    border-radius: 0; /* Make it square */
    margin: 0;
    font-size: 1.1rem; /* Slightly larger font */
    font-weight: 700; /* Bolder font weight */
    color: #0056b3; /* A distinct color for the text */
    text-align: center;
    border: 1px solid #d0d0d0;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    height: 60px; /* Give the button a fixed height */
    background-color: transparent;
    background-image: url('../img/confirm_on.jpg'); /* Now uses confirm image */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
    outline: none; /* Remove focus outline */
}

.submit-btn:hover {
    background-image: url('../img/confirm_on.jpg'); /* Keep original image on hover */
}

.submit-btn:active {
    background-image: url('../img/confirm_tap.jpg'); /* Now uses confirm tap image */
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Terms and Conditions New Layout */
.terms-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem; /* Space between the link and the checkbox line */
    margin-bottom: 1.5rem;
}

.terms-link-container {
    text-align: center;
}

.terms-link {
    color: #0056b3;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
}

.terms-agree-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.terms-agree-container label {
    font-size: 1rem;
    margin: 0;
    padding-left: 10px; /* Space between checkbox and text */
}

/* Custom Checkbox Styling */
.terms-agree-container input[type="checkbox"] {
    appearance: none; /* Hide default checkbox */
    -webkit-appearance: none;
    background-color: #fff;
    border: 2px solid #ccc;
    width: 24px;
    height: 24px;
    cursor: pointer;
    position: relative;
    display: inline-block; /* Align with text */
}

.terms-agree-container input[type="checkbox"]:checked {
    background-color: #002A4E; /* Dark blue when checked */
    border-color: #002A4E;
}

.terms-agree-container input[type="checkbox"]:checked::after {
        content: "✓";
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        font-size: 18px;
        color: #fff;
        font-family: Arial, Helvetica, sans-serif;
        line-height: 1;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    width: 90%;
    max-width: 700px;
    max-height: 80vh; /* 80% of the viewport height */
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-content h2 {
    margin-top: 0;
}

.terms-text {
    flex-grow: 1; /* Allows this element to take up available space */
    min-width: 0;
    overflow-y: auto; /* Makes only this part scrollable */
    overflow-x: hidden;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

/* Confirmation Modal Specifics */
.confirm-details {
    margin-bottom: 2rem;
    text-align: left;
}

.confirm-details p {
    margin: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.confirm-details strong {
    display: inline-block;
    width: 100px; /* Align labels */
}

.confirm-details p.confirm-stacked {
    display: flex; /* Use flexbox for stacked layout */
    flex-direction: column;
    align-items: flex-start; /* Align content to the left */
}

.confirm-details p.confirm-stacked strong {
    display: block; /* Force label to its own line */
    width: auto; /* Allow label to take its natural width */
    margin-bottom: 0.2rem; /* Small space between label and value */
}

.confirm-details p.confirm-stacked .confirm-value {
    padding-left: 10px; /* Indent the value slightly */
    word-break: break-all; /* Ensures long emails wrap nicely */
}

.confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.back-btn, .confirm-btn {
    width: 100%;
    max-width: 200px;
    height: 50px;
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
    outline: none; /* Remove focus outline */
}

.back-btn {
    background-image: url('../img/back_on.jpg');
}

.back-btn:active {
    background-image: url('../img/back_tap.jpg');
}

.confirm-btn {
    background-image: url('../img/apply_on.jpg'); /* Now uses Apply image */
}

.confirm-btn:active {
    background-image: url('../img/apply_tap.jpg'); /* Now uses Apply tap image */
}

/* Footer */
.footer {
    width: 100%;
    text-align: center;
    padding: 1rem;
    box-sizing: border-box;
}

.copyright {
    max-width: 100%;
    height: auto;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .data-form {
        padding: 1.5rem;
    }

    /* .logo styling removed as global rule handles it responsively */
}
/* The old 480px breakpoint for form-group-row is no longer needed 
   as flex-wrap handles the stacking automatically. */
@media (max-width: 480px) {
    .form-group-row .form-group {
         margin-bottom: 0;
    }
    
    .data-form {
        padding: 1rem;
    }

    .submit-btn {
        font-size: 1.1rem;
    }
}

/* Centered Message Container (for Error/Thank You pages) */
.message-container {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    flex-grow: 1; /* Make it fill the space within the main container */
}

.message-text {
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black background */
    padding: 2rem;
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

#house-input {
    text-align: center;
}

.text-center {
    text-align: center;
}
.txt-white {
    color : #fff;
}
