@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap');

/* Global Reset */
* {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    border: none;
    text-decoration: none;
    -webkit-font-smoothing: antialiased; /* for Safari */
    -moz-osx-font-smoothing: grayscale;  /* for Firefox on Mac */
}

/* Container */
.container {
    min-height: 100vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    padding: 30px;
}

/* Centered Content */
.container .content {
    text-align: center;
}

/* Responsive Image */
.resizable-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Input Container */
.input-container {
    position: relative;
    margin: 15px 0;
}

/* Icon Input Styling */
.input-icon {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 12px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

/* Icon Style */
.input-icon i {
    color: #75767c;
    margin-right: 10px;
}

/* Input Field */
.input-icon input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 16px;
    padding: 0;
    background: transparent;
    transition: all 0.3s ease;
}

/* On Focus Scale */
.input-icon input:focus {
    transform: scale(1.02);
}

/* Label Style */
.form-label {
    position: absolute;
    top: 12px;
    left: 45px;
    background-color: white;
    color: #75767c;
    font-size: 16px;
    padding: 0 5px;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Floating Label */
.input-container input:focus + .form-label,
.input-container input:not(:placeholder-shown) + .form-label {
    color: #2f353c;
    top: -10px;
    left: 10px;
    font-size: 12px;
    background-color: white;
}

/* Input Focus Box */
.input-icon:focus-within {
    border-color: #2f353c;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

/* Form Container */
.form-container {
    min-height: 100vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    margin: auto 0;
}

/* Form Box */
.form-container form {
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    background: #fff;
    text-align: center;
    width: 350px;
}

/* Select Dropdown */
.form-container form select option {
    background: #fff;
}

/* Button */
.form-container form .form-btn {
    background: #45535e;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 4px;
    outline: none;
    transition: background 0.3s ease;
}

/* Button Hover */
.form-container form .form-btn:hover {
    background: #0a605f;
    color: #fff;
}

/* Paragraph Text */
.form-container form p {
    margin-top: 10px;
    font-size: 12px;
    color: #333;
}

/* Link Color */
.form-container form p a {
    color: #00A950;
}

/* Error Message */
.form-container form .error-msg {
    margin: 10px 0;
    display: block;
    background: crimson;
    color: #fff;
    border-radius: 3px;
    font-size: 15px;
    padding: 10px;
}

/* Login page only background */
/* Login page only background */
body.login-page {
    background-image: url('../Image/loginbackground.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
}

/* Shared login background for auth pages */
.login-bg {
    background-image: url('../Image/loginbackground.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
}

/* Password visibility toggle */
.toggle-container {
    margin-bottom: 20px;
    font-size: 14px;
    color: gray;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s;
}

.toggle-switch.on {
    background-color: #0a605f;
}

.toggle-switch.on:before {
    left: 22px;
}

.toggle-label {
    font-size: 12px;
}

.forgot-password-link {
    font-size: 12px;
    color: gray;
    text-decoration: none;
}

.version-text {
    color: gray;
    font-family: Arial, sans-serif;
    font-size: 8px;
}

/* Install modal */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.modal-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-buttons button {
    padding: 6px 12px;
    background-color: #00bf63;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.terms-modal-dialog {
    max-width: min(960px, 96vw);
}

.terms-modal-content {
    border-radius: 12px;
    overflow: hidden;
}

.terms-modal-body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.terms-content-scroll {
    max-height: min(62vh, 560px);
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    text-align: left;
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 12px;
    flex: 1 1 auto;
}

.terms-content-scroll h6 {
    margin-top: 12px;
    margin-bottom: 8px;
    font-weight: 700;
}

.terms-content-scroll h6:first-child {
    margin-top: 0;
}

.terms-content-scroll ul {
    margin-bottom: 0.75rem;
    padding-left: 1.2rem;
}

.terms-modal-body .form-check {
    margin-top: 0.75rem;
    flex: 0 0 auto;
}

/* make modal content fit vertically and avoid overlap with footer */
.terms-modal-content {
    max-height: 96vh;
    display: flex;
    flex-direction: column;
}

#termsModal .modal-footer {
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    .terms-modal-dialog {
        max-width: calc(100vw - 1rem);
        margin: 0.5rem auto;
    }

    .terms-modal-content {
        height: calc(100dvh - 1rem);
        min-height: calc(100vh - 1rem);
    }

    .terms-modal-body {
        padding: 0.75rem;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .terms-content-scroll {
        flex: 1 1 auto;
        max-height: none;
        font-size: 0.86rem;
        line-height: 1.42;
        padding: 10px;
    }

    .terms-content-scroll h6 {
        font-size: 0.95rem;
        margin-top: 10px;
        margin-bottom: 6px;
    }

    .terms-modal-body .form-check {
        margin-top: 0.75rem !important;
    }

    .terms-modal-body .form-check-label {
        font-size: 0.84rem;
        line-height: 1.35;
    }

    #termsModal .modal-footer {
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
    }


/* Email verified page tweaks */
.email-verified-card {
    max-width: 420px;
    margin: 0 auto;
    border-radius: 10px;
}

/* Register password page styles moved from inline */
.card-title-header {
    position: relative;
    z-index: 10;
    background: rgba(255,255,255,0.95);
    padding: 0.5rem;
    border-radius: 0.25rem;
}

/* Reduce autofill background artifacts in WebKit browsers */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px rgba(255,255,255,0.01) inset !important;
    -webkit-text-fill-color: #000 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Requirement list icons */
#pw-requirements li { display: flex; align-items: center; gap: .5rem; }
#pw-requirements .icon { width: 18px; text-align: center; display: inline-block; }
.is-valid + .form-text { color: #198754; }
.is-invalid + .form-text { color: #dc3545; }

/* Offscreen input helper to capture autofill */
.offscreen-input { position: absolute !important; left: -9999px !important; top: auto !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* Password page shared styles */
.password-bg {
    /* Try absolute path first, then relative fallback for local dev servers */
    background-image: url('/assets/Image/loginbackground.webp'), url('../Image/loginbackground.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
}
.container-wrapper { max-width: 540px; margin: 0 auto; }
.card-title-header { padding-top: 8px; padding-bottom: 8px; }
.icon { display:inline-block; width:1.2em; }

    #termsModal .modal-footer .btn {
        flex: 1 1 50%;
        padding: 0.45rem 0.6rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
}

@media (max-width: 399.98px) {
    .terms-modal-dialog {
        max-width: calc(100vw - 0.5rem);
        margin: 0.25rem auto;
    }

    .terms-modal-content {
        height: calc(100dvh - 0.5rem);
        min-height: calc(100vh - 0.5rem);
    }

    .terms-content-scroll {
        font-size: 0.82rem;
        padding: 9px;
    }

    .terms-modal-body .form-check-label {
        font-size: 0.8rem;
    }

    #termsModal .modal-title {
        font-size: 1rem;
    }
}

/* Registration page */
body.register-page {
    background-image: url('../Image/loginbackground.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: auto;
    font-family: Arial, sans-serif;
}

body.register-page .form-container {
    background-color: rgba(255, 255, 255, 0.1);
    margin-top: auto;
    margin-bottom: auto;
    padding: 20px;
}

/* Bootstrap modal customization for success modal */
#successModal .btn-primary {
    background-color: #45535e;
    border-color: #45535e;
}

#successModal .btn-primary:hover {
    background-color: #0a605f;
    border-color: #0a605f;
}

body.register-page #birthdate:focus + .custom-label,
body.register-page #birthdate:valid + .custom-label {
    transform: translateY(-120%);
    font-size: 12px;
}

body.register-page .error-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

body.register-page .error-modal .modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    width: 300px;
    text-align: center;
    position: relative;
}

body.register-page #error-msg {
    color: #45535e;
    font-size: 15px;
}

body.register-page .close-btn {
    background-color: #ff0000;
    color: #fff;
    font-size: 16px;
    padding: 5px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

body.register-page .close-btn:hover {
    background-color: #cc0000;
}

@media screen and (max-width: 600px) {
    body.register-page #successModal button {
        width: 100%;
    }

    body.register-page #successModal .modal-content {
        max-width: 100%;
    }
}

/* Register email sending page */
body.register-email-loading-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2f3f50;
    background-image: url('../Image/loginbackground.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: auto;
}

body.register-email-loading-page .register-email-loading-card {
    width: min(92vw, 520px);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(26, 43, 60, 0.12);
    padding: 28px 24px;
    text-align: center;
}

body.register-email-loading-page .register-email-loading-title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 700;
}

body.register-email-loading-page .register-email-loading-subtitle {
    margin: 0 0 18px;
    font-size: 14px;
    color: #5f6f7f;
}

body.register-email-loading-page .register-email-loading-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #dce6ef;
    overflow: hidden;
}

body.register-email-loading-page .register-email-loading-bar {
    height: 100%;
    width: 38%;
    border-radius: 999px;
    animation: registerEmailIndeterminate 1.2s ease-in-out infinite;
    transform-origin: left center;
    background: #ffffff;


}

@keyframes registerEmailIndeterminate {
    0% { transform: translateX(-120%); }
    50% { transform: translateX(120%); }
    100% { transform: translateX(-120%); }
}

