/* Importing Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&display=swap");

/* === CSS Reset === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 100%; /* Base for rem units */
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    width: 100%;
    font-family: "Open Sans", sans-serif;
    background: url("images/hero-bg.jpg") center / cover no-repeat fixed;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Viewport Meta (Add this in <head> of HTML!) === */
/* <meta name="viewport" content="width=device-width, initial-scale=1.0"> */

/* Remove @viewport and meta selector — they don't work reliably */
@viewport { width: device-width; } /* Not widely supported */
meta[name="viewport"] { content: "..."; } /* Invalid CSS */

/* === Layout === */
.content-wrapper {
    flex: 1;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

/* === Header & Navbar === */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0 10px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* Safari support */
}

.navbar {
    display: flex;
    padding: clamp(12px, 2.5vw, 21px) 0;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: space-between;
    width: 100%;
}

.navbar .logo img {
    width: clamp(100px, 15vw, 150px);
    max-width: 100%;
    height: auto;
    display: block;
}

.navbar .menu-btn {
    display: none;
    color: #aa0c0c;
    cursor: pointer;
    font-size: clamp(1.3rem, 4vw, 1.5rem);
    background: none;
    border: none;
}

.navbar .links {
    display: flex;
    list-style: none;
    gap: clamp(20px, 3vw, 33px);
    align-items: center;
}

.navbar .links .close-btn {
    display: none;
}

.navbar .links a {
    color: #3f3939;
    text-decoration: none;
    font-size: clamp(0.95rem, 2.2vw, 1.1rem);
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.navbar .links a:hover {
    color: #19e8ff;
}

.navbar .login-btn {
    border: none;
    outline: none;
    color: #275360;
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-weight: 600;
    padding: clamp(8px, 1.5vw, 10px) clamp(14px, 2.5vw, 17px);
    border-radius: 2px;
    cursor: pointer;
    background: #fff;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.navbar .login-btn:hover {
    background: #f0f8ff;
}

/* === Blur Overlay & Popup === */
.blur-bg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1090;
}

.show-popup .blur-bg-overlay {
    opacity: 1;
    pointer-events: auto;
}

.form-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    background: #fff;
    max-width: 720px;
    width: calc(100% - 30px);
    max-height: 90vh;
    opacity: 0;
    pointer-events: none;
    border: 2px solid #fff;
    border-radius: 8px;
    z-index: 1100;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.show-popup .form-popup {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
}

.form-popup .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #878784;
    cursor: pointer;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    z-index: 1;
    background: rgba(255, 255, 255, 0.9);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.form-popup .form-box {
    display: flex;
    flex-wrap: wrap;
    min-height: 100%;
}

.form-box .form-details {
    max-width: 330px;
    width: 100%;
    color: #fff;
    padding: clamp(15px, 3vw, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
}

.login .form-details {
    background-image: url("images/login-img.jpg") center / cover no-repeat;
}

.signup .form-details {
    background-image: url("images/signin-img.jpg")center / cover no-repeat;
}

.form-box .h2 {
    font-family: "Orbitron", sans-serif;
    color: #00ffcc;
    font-weight: 700;
    font-size: clamp(1.6rem, 5vw, 2rem);
    margin-bottom: 30px;
    text-align: center;
}

.form-box .form-coentnt { /* Fixed typo: form-coentnt → form-content */
    width: 100%;
    padding: clamp(20px, 5vw, 35px);
    display: flex;
    flex-direction: column;
}

/* === Form Inputs === */
form .input-field {
    height: clamp(45px, 10vw, 50px);
    width: 100%;
    margin-top: 20px;
    position: relative;
}

form .input-field input {
    width: 100%;
    height: 100%;
    outline: none;
    padding: 0 15px;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    border-radius: 3px;
    border: 1px solid #717171;
    background: #fff;
    transition: border-color 0.2s ease;
}

form .input-field label {
    position: absolute;
    top: 50%;
    left: 15px;
    color: #717171;
    pointer-events: none;
    transform: translateY(-50%);
    transition: all 0.2s ease;
    font-size: clamp(0.95rem, 2.3vw, 1rem);
    background: #fff;
    padding: 0 4px;
}

.input-field input:focus {
    border-color: #00bcd4;
}

.input-field input:is(:focus, :valid) {
    padding: clamp(14px, 3vw, 16px) 15px 0;
}

.input-field input:is(:focus, :valid) ~ label {
    color: #00bcdd;
    font-size: 0.75rem;
    transform: translateY(-120%);
    background: #fff;
    padding: 0 4px;
}

/* === Links & Buttons === */
.form-box a {
    color: #00bcd4;
    text-decoration: none;
    font-size: clamp(0.95rem, 22.3vw, 1rem);
}

.form-box a:hover {
    text-decoration: underline;
}

.form-box :where(.forgot-pass, .policy-text) {
    display: inline-flex;
    margin-top: 14px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    flex-wrap: wrap;
    gap: 5px;
}

form button {
    width: 100%;
    outline: none;
    border: none;
    font-size: clamp(1.05rem, 2.4vw, 1.15rem);
    font-weight: 500;
    padding: clamp(12px, 2.5vw, 14px);
    border-radius: 3px;
    margin: 25px 0;
    color: #fff;
    cursor: pointer;
    background: #00bcd4;
    transition: background 0.2s ease;
}

form button:hover {
    background: #0097a7;
}

.form-box .bottom-link {
    text-align: center;
    font-size: clamp(1rem, 2.3vw, 1.05rem);
}

/* === Form Toggle === */
.form-popup .signup,
.form-popup.show-signup .login {
    display: none;
}

.form-popup.show-signup .signup {
    display: flex;
}

.signup .policy-text {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    flex-wrap: wrap;
}

.signup .policy-text input {
    width: clamp(13px, 3vw, 14px);
    height: clamp(13px, 3vw, 14px);
    margin-top: 2px;
    flex-shrink: 0;
}

/* === Mobile Navigation === */
@media (max-width: 950px) {
    .navbar .menu-btn {
        display: block;
    }

    .navbar .links {
        position: fixed;
        left: -100%;
        top: 0;
        width: 100%;
        height: 100dvh;
        display: flex;
        flex-direction: column;
        padding-top: 70px;
        background: #fff;
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 999;
        gap: 0;
    }

    .navbar .links.show-menu {
        left: 0;
    }

    .navbar .links .close-btn {
        display: block;
        position: absolute;
        right: 20px;
        top: 20px;
        color: #000;
        font-size: 1.5rem;
        background: none;
        border: none;
    }

    .navbar .links a {
        color: #000;
        font-size: clamp(1.2rem, 4vw, 1.4rem);
        padding: clamp(15px, 3vw, 20px);
        border-bottom: 1px solid #eee;
        display: block;
    }

    .navbar .links a:hover {
        background: #f0f8ff;
        color: #00bcd4;
    }

    .navbar .login-btn {
        margin: 10px auto;
        display: block;
        width: fit-content;
    }

    .navbar .logo img {
        width: clamp(90px, 12vw, 120px);
    }
}

/* === Tablet & Small Screens === */
@media (max-width: 760px) {
    .form-popup {
        width: calc(100% - 20px);
        max-width: 400px;
    }

    .form-box .form-details {
        display: none;
    }

    .form-box .form-coentnt {
        padding: clamp(25px, 6vw, 30px) clamp(15px, 4vw, 20px);
    }

    .form-box .h2 {
        margin-bottom: 20px;
    }
}

/* === Mobile Small === */
@media (max-width: 480px) {
    .navbar {
        padding: 10px 0;
    }

    .navbar .logo img {
        width: 90px;
    }

    .form-popup {
        width: calc(100% - 10px);
        border-radius: 6px;
    }

    .form-box .form-coentnt {
        padding: 20px 12px;
    }

    form .input-field {
        margin-top: 16px;
    }

    form button {
        margin: 20px 0;
    }
}

/* === Prevent iOS Zoom on Input Focus === */
input, textarea, select, button {
    font-size: max(16px, 1em); /* Prevents zoom */
}

/* === High DPI / Retina Images === */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login .form-details {
        background-image: url("images/login-img@2x.jpg");
    }
    .signup .form-details {
        background-image: url("images/signin-img@2x.jpg");
    }
}
