
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            height: 100vh;
            display: grid;
            grid-template-rows: 1fr; 
            font-family: sans-serif;
            text-align: center;
        }

        .small {
            font-size: 0.9em;
            color: #555;
            margin-top: 5px;
            text-align: left;
        }

        .left {
            text-align: left;
        }

        p.title {
            font-size: 1.0em;
            font-weight: bold;
            margin-top: 10px;
        }

        p.value {
            font-size: 1.0em;
            font-weight: normal;
            margin-bottom: 15px;
        }

        .top-row-container {
            display: grid;
            /* By default, we let the visible row take the full height */
            grid-template-rows: auto 1fr;
            height: 100%; 
        }

        /* Adjust the banner image container */
        .main-row-1 {
            display: flex;
            justify-content: center;
            width: 100%;
            background-color: #ffffff;
            padding-bottom: 0; /* Ensures no gap below the image */
        }

        .deep-nested-1 img {
            display: block;
            max-height: 250px; /* Slightly reduced height to pull form up */
            width: auto;
        }

        .deep-nested-2 {
            display: none;
            align-items: center;
            justify-content: center;
        }

        /* The simple second row */
        .main-row-2 {
            background-color: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* FOOTER STRUCTURE */
        footer {
            background-color: #263779;
            color: white;
            display: grid;
            grid-template-rows: auto auto; 
        }

        .footer-row-1 {
            display: grid;
            color: #263779;
            background-color: #ffffff;
            /* grid-template-columns: 1fr 1fr; */
            border-bottom: 1px solid #444;
        }

        .footer-row-2 {
            padding: 5px;
        }

        .footer-col { padding: 20px; }

        /* --- VISIBILITY LOGIC --- */

        /* DESKTOP VIEW (Width > 600px) */
        @media (min-width: 601px) {
            .deep-nested-1 {
                display: flex; /* Hide the second row */
            }
            .deep-nested-2 {
                display: none; /* Show the nested row */
            }
        }

        /* MOBILE VIEW (Width <= 600px) */
        @media (max-width: 600px) {
            .deep-nested-1 {
                display: none; /* Hide the nested row */
            }
            .deep-nested-2 {
                display: flex; /* Show the second row */
            }
        }

/*
        #formWrapper{
            width:100%; 
            height:100%; 
            position: relative; 
            top:0; 
            left:0;
            transition:all .3s ease;
            overflow-y: auto; 
            overflow-x: hidden;
        }

        div#form{
            position: absolute;
            width:360px;
            height:320px;
            height:auto;
            background-color: #fff;
            margin:auto;
            border-radius: 25px;
            padding:20px;
            left:50%;
            top:50%;
            margin-left:-180px;
            margin-top:-300px;
        }
*/

        /* Update the wrapper to stack elements vertically */
        #formWrapper {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column; /* Stacks image and form vertically */
            align-items: center;
            overflow-y: auto;
            overflow-x: hidden;
        }

        /* Update the form container */
        div#form {
            position: relative;
            width: 360px;
            background-color: #fff;
            margin: 0 auto; /* Removed the -300px margin */
            border-radius: 25px;
            padding: 10px 20px; /* Reduced padding to tighten space */
            /* Remove top: 50% and left: 50% if they were there */
        }

        div.form-item{
            position: relative; 
            display: block; 
            margin-bottom: 20px;
        }

        div.form-item h2{
            padding-bottom: 20px;
            font-style: italic;
        }

        input{
            transition: all .2s ease;
        }
        
        input.form-style{
            color:#8a8a8a;
            display: block;
            width: 90%;
            height: 44px;
            padding: 5px 5%;
            border:1px solid #ccc;
            -moz-border-radius: 27px;
            -webkit-border-radius: 27px;
            border-radius: 27px;
            -moz-background-clip: padding;
            -webkit-background-clip: padding-box;
            background-clip: padding-box;
            background-color: #fff;
            font-family:'HelveticaNeue','Arial', sans-serif;
            font-size: 105%;
            letter-spacing: .8px;
        }

        .input-item{
            position: relative;
            margin-bottom: 15px
            }
        .input-item input{
            display: block;
            height: 40px;
            background: transparent;
            border: solid 1px #ccc;
            transition: all .3s ease;
            padding: 0 15px
        }
        .input-item input:focus{
            border-color: blue
        }
        .input-item label{
            position: absolute;
            cursor: text;
            z-index: 2;
            top: 13px;
            left: 10px;
            font-size: 12px;
            font-weight: bold;
            background: #fff;
            padding: 0 10px;
            color: #999;
            transition: all .3s ease
        }
        .input-item input:focus + label,
        .input-item input:valid + label{
            font-size: 11px;
            top: -5px
        }
        .input-item input:focus + label{
            color: blue
        }

        div.form-item .form-style:focus{
            outline: none; 
            border:1px solid #58bff6; 
            color:#58bff6; 
        }

        div.form-item p.formLabel {
            position: absolute;
            left:26px;
            top:2px;
            transition:all .4s ease;
            color:#bbb;
        }

        .login{
            width: 90%;
            height: 44px;
            -moz-border-radius: 19px;
            -webkit-border-radius: 19px;
            border-radius: 19px;
            -moz-background-clip: padding;
            -webkit-background-clip: padding-box;
            background-clip: padding-box;
            background-color: #55b1df;
            border:1px solid #55b1df;
            border:none;
            color: #fff;
            font-weight: bold;
        }


        .reset-btn {
            width: 90%;
            height: 44px;
            margin-top: 15px;
            border-radius: 19px;
            background-color: #6c757d; /* Gray color */
            border: none;
            color: #fff;
            font-weight: bold;
            cursor: pointer;
            transition: background 0.3s ease;
        }

        .reset-btn:hover {
            background-color: #5a6268;
        }

        .blue-bold{
            color: #263779;
            font-weight: bold;
            font-style: italic;
            text-decoration: none;
        }

        /* The Spinner Animation */
        .loader {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #3498db;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            animation: spin 1s linear infinite;
            display: none; /* Hidden by default */
            margin: 10px 0;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        #result { margin-top: 15px; font-weight: bold; }

        /* MODAL */
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal-box {
            background: #fff;
            border-radius: 16px;
            padding: 24px 20px;
            width: min(90%, 420px);
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
            text-align: left;
            position: relative;
        }

        .modal-box h3 {
            margin-bottom: 14px;
            font-size: 1em;
            color: #1200af;
            border-bottom: 1px solid #eee;
            padding-bottom: 10px;
        }

        .modal-box p.modal-label {
            font-size: 0.85em;
            color: #888;
            margin-bottom: 2px;
            margin-top: 12px;
        }

        .modal-box p.modal-value {
            font-size: 0.95em;
            font-weight: bold;
            color: #333;
        }

        .modal-close {
            margin-top: 20px;
            width: 100%;
            height: 40px;
            border-radius: 19px;
            background-color: #1200af;
            border: none;
            color: #fff;
            font-weight: bold;
            cursor: pointer;
        }

        .agensi-link {
            color: #1200af;
            font-weight: bold;
            cursor: pointer;
            text-decoration: underline;
        }

        /* LANDSCAPE ORIENTATION LOCK FOR MOBILE */
        @media (max-height: 500px) and (orientation: landscape) and (max-width: 900px) {
            body {
                display: flex;
                align-items: center;
                justify-content: center;
            }

            main,
            footer,
            .top-row-container,
            .main-row-1,
            .main-row-2,
            #formWrapper,
            #form {
                display: none;
            }

            body::before {
                content: "Sila putar peranti ke mod potret untuk menggunakan aplikasi ini";
                position: fixed;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                text-align: center;
                font-size: 18px;
                font-weight: bold;
                color: #333;
                background-color: #f0f0f0;
                padding: 30px 20px;
                border-radius: 10px;
                width: 90%;
                z-index: 9999;
                box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            }
        }
