/* Resetting some default styles */
body, h1, p, label, input, button, table {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', 'Arial', 'Arial';
    letter-spacing: 0.3px; /* Subtle spacing for smoother look */
    font-weight: 400; /* Slightly lighter default weight for a modern feel */
}

label, button, input, textarea, th, td {
    font-weight: 400; /* Keep form elements clean and light */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.05); /* Gentle depth for titles */
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #000000; /* Light background to emphasize the 3D effect */
    margin: 0;
}

.phone-frame {
    width: 100%;
    max-width: 360px; /* Maximum width for the phone frame */
    height: 100%;
    max-height: 640px; /* Maximum height for the phone frame */
    background: #fff;
    border: 8px solid #333;
    border-radius: 36px;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), /* Large shadow for depth */
                0 4px 8px rgba(0, 0, 0, 0.2);  /* Smaller shadow for more depth */
    transform: rotateX(2deg) rotateY(-2deg); /* Subtle tilt for 3D effect */
    overflow: hidden; /* Ensures that the internal content doesn't overflow outside the phone frame */
    background: linear-gradient(180deg, #000000, #000000); /* Gradient for glossy effect */}

.phone-footer {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 5px;
    background: #333;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* Slight shadow for a subtle 3D effect */
}

.phone-header {
    text-align: center;
    padding: 2px;
    background-color: #333;
    color: #fff;
    overflow: hidden; /* Hide overflow to prevent any part of the image from showing outside */
}

.phone-header img {
    width: 80%; /* Make the image take the full width of the container */
    height: auto; /* Keep the height auto to maintain aspect ratio */
    object-fit: contain; /* Scale the image to cover the container */
    object-position: center; /* Center the image */
}

.phone-screen {
    padding: 10px; /* Adjust padding for a better fit */
    height: calc(100% - 50px - 50px); /* Adjust height to ensure space for footer and button */
    overflow-y: auto;
    text-align: center;
    background: #ffffff; /* Light background color for the screen */
    border-radius: 10px; /* Match the frame’s border radius for a smooth look */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2); /* Inner shadow for a recessed effect */
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px; /* Adjust font size to fit smaller screens */
}

.phone-screen h1 {
    margin-bottom: 2px;
    font-size: 18px; /* Adjust font size for better fit */
    color: #000000; /* Black text for the title */
}

.phone-image {
    max-width: 100%; /* Ensures image scales with screen size */
    height: auto; /* Maintain aspect ratio */
    margin-bottom: 10px; /* Reduced space between the image and the form */
    border-radius: 10px; /* Optional: rounded corners for a smoother look */
}

form {
    display: flex;
    flex-direction: column;
    gap: 0px; /* Reduced space between sections */
}

fieldset.group-fieldset {
    border: 2px solid #4D4D4D; /* Dark border for the fieldset */
    border-radius: 2px;
    padding: 2px;
    background-color: #CCFFCC; /* White background for the fieldset */
}

legend {
    font-weight: bold;
    font-weight: 400; /* Slightly lighter default weight for a modern feel */
    padding: 2px 10px;
    border-radius: 5px; /* Rounded corners */
    background-color: #000000; /* Light grey background for legend */
    color: #fff; /* Dark text color for the legend */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
}

.field-group {
    margin-bottom: 2px; /* Reduced space between field groups */
}

.payments-grid, .dues-grid {
    display: flex;
    flex-wrap: wrap; /* Allow columns to wrap if needed */
    gap: 4px; /* Reduced gap between columns */
    justify-content: center; /* Center columns horizontally */
}

.payment-column, .due-column {
    display: flex;
    flex-direction: column;
    gap: 2px; /* Space between fields in columns */
    max-width: 120px; /* Increased max-width for better fit */
    width: 30%; /* Ensure columns take full available width */
}

/* Add these fields to match the style of payment fields */
.billable-field, .payment-field, .balance-field, .due-field, .grand-total-field {
    width: 100%; /* Ensure fields take full width of their container */
    padding: 2px; /* Adjust padding for consistency */
    max-width: 120px; /* Keep the fields' max width consistent */
    font-size: 12px; /* Consistent font size for all fields */
    border: 1px solid #ccc; /* Border to match all fields */
    border-radius: 5px; /* Rounded corners for consistency */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* Inner shadow for depth */
    text-align: center; /* Center the text in all fields for uniformity */
}

.grand-total-field {
    padding-left: 4px; /* Add padding to align text inside the field */
    text-align: left; /* Align text to the left */
}

/* Hide spinners for number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield; /* Hide spinners for Firefox, Chrome, Safari, Edge */
}

.button-container {
    display: flex;
    gap: 10px; /* Space between buttons */
    z-index: 1; /* Ensure buttons stay above other elements */
    align-items: center;
}

button {
    padding: 4px 4px; /* Reduced padding to make button fit better */
    border: solid 2px #4D4D4D; /* Border for visibility */
    border-radius: 5px;
    background-color: #008000; /* Bright green background */
    color: #ffffff; /* Black text color */
    font-size: 14px; /* Reduced font size for better fit */
    cursor: pointer;
    align-self: center; /* Center button horizontally */
    margin-top: 2px; /* Reduced space above the button */
    bottom: 20px; /* Positioning the button at the bottom of the container */
    z-index: 1; /* Ensure buttons stay above other elements */
    transition: transform 0.1s ease, opacity 0.2s ease;
    width: 100%; /*
    justify-content: center; /* Horizontally center */
    align-items: center; /* Vertically center */
}

.processButton:active {
  transform: scale(0.96); /* Slight shrink */
  opacity: 0.7;            /* Optional fade */
}

button:hover {
    background: linear-gradient(145deg, #009900, #00FF00); /* Reversed gradient for hover effect */
}

.hidden {
    display: none;
}

@media (max-width: 400px) {
    .phone-frame {
        max-width: 100%;
        max-height: 100vh; /* Limit maximum height to viewport height */
    }

    /* Ensure button is visible on smaller screens */
    button {
        margin-top: 2px; /* Adjusted margin for better visibility */
    }
}
