/* Background */
.background{
    position: fixed;
    inset: 0;
    background: url("/images/bg.png") center center/cover no-repeat;
    filter: blur(3.5px);
    transform: scale(1.05);
    opacity: .8;
    z-index: -2;
}

.background::after{
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.12);
}

html, body{
    height: 100%;
    margin: 0;
}

/* Page layout: natural flow instead of magic-number absolute positioning,
   so the card sizes to its own content on every screen. */
body{
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 4vh, 32px);
    padding: clamp(24px, 6vh, 48px) 20px;
    box-sizing: border-box;
}

/* Logo */
.logo-container{
    display: flex;
    justify-content: center;
}

.logo{
    width: clamp(112px, 30vw, 136px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(4px 6px 8px rgba(0,0,0,.5));
}

/* Login Card */
.login-card{
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: clamp(20px, 4vw, 32px);
    box-shadow: 2px 4px 10px rgba(136,0,0,.35);
    padding: clamp(24px, 5vw, 36px) clamp(22px, 5vw, 36px);
    box-sizing: border-box;
}

/* Heading */
.login-card h1{
    font-family: "Koh Santepheap", serif;
    font-size: clamp(28px, 6vw, 42px);
    font-weight: 700;
    color: #880000;
    text-align: center;
    margin: 0 0 clamp(20px, 5vw, 36px);
}

/* Labels */
.login-card label{
    display: block;
    margin-bottom: 8px;
    font-family: "Koh Santepheap", serif;
    font-size: 16px;
    font-weight: bold;
    color: #880000;
}

/* Form Groups */
.form-group{
    margin-bottom: clamp(16px, 4vw, 24px);
}

/* Inputs */
.login-card input{
    width: 100%;
    height: 44px;
    border: 1px solid #880000;
    border-radius: 14px;
    background: rgba(255,255,255,.7);
    padding: 0 16px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
}

/* Password */
.password-box{
    position: relative;
}

.eye-icon{
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    cursor: pointer;
}

/* Login Button */
.login-card button{
    width: 100%;
    height: 44px;
    background: #880000;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: "Koh Santepheap", serif;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 4px 4px rgba(0,0,0,.25);
    transition: .3s;
}

.login-card button:hover{
    background: #6f0000;
}

/* Sign Up / Login switch link (shared by login.blade.php's .login
   and signup.blade.php's .signup) */
.signup,
.login{
    text-align: center;
    margin-top: 20px;
    font-family: "Koh Santepheap", serif;
    font-size: 13px;
    color: #880000;
}

/* "Forgot password?" -- shown on the login form only after a failed attempt */
.forgot-row{
    text-align: right;
    margin: -4px 0 12px;
    font-family: "Koh Santepheap", serif;
    font-size: 13px;
}

.forgot-row a{
    color: #ED0D0D;
    text-decoration: underline;
}

.forgot-row a:hover{
    color: #880000;
}

.signup a,
.login a{
    color: #ED0D0D;
    text-decoration: underline;
    margin-left: 5px;
}

/* ===================== "log in to join a group" popup =====================
   Shown on login/signup when the visitor was routed here from the My
   Group QR/share link (see auth/login.blade.php, auth/signup.blade.php,
   and JoinGroupController) -- purely informational, dismissible, doesn't
   block the form underneath it. */
.join-popup-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.join-popup-box{
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(0,0,0,.28);
    padding: 28px 24px 24px;
    text-align: center;
    box-sizing: border-box;
}

.join-popup-title{
    font-family: "Koh Santepheap", serif;
    font-weight: 700;
    font-size: 20px;
    color: #880000;
    margin-bottom: 10px;
}

.join-popup-text{
    font-family: "Koh Santepheap", serif;
    font-size: 14px;
    color: #5a5a5a;
    line-height: 1.5;
    margin-bottom: 20px;
}

.join-popup-close{
    width: 100%;
    height: 42px;
    background: #880000;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: "Koh Santepheap", serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: .3s;
}

.join-popup-close:hover{
    background: #6f0000;
}

/* Desktop */
@media (min-width: 992px){

    body{
        flex-direction: row;
        justify-content: center;
        gap: clamp(48px, 8vw, 120px);
        padding: 40px;
    }

    .logo-container{
        width: min(420px, 32vw);
    }

    .logo{
        width: 100%;
        max-width: 420px;
    }

    .login-card{
        width: 420px;
        padding: 40px;
    }

}

/* ===================== checkbox rows (Keep me signed in / Privacy Policy) =====================
   .login-card input{} above makes every input full width + 44px tall, so the
   checkbox needs its own, more specific rule. */
.check-row{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: -4px 0 16px;
}

.login-card .check-row input[type="checkbox"]{
    width: 20px;
    height: 20px;
    min-width: 20px;
    padding: 0;
    margin: 1px 0 0;
    border-radius: 5px;
    accent-color: #880000;
    cursor: pointer;
}

.login-card .check-row label{
    margin: 0;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.45;
    cursor: pointer;
}

.policy-link{
    color: #ED0D0D;
    font-weight: bold;
    text-decoration: underline;
}

/* ===================== Privacy Policy pop-up ===================== */
.privacy-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1100;
}

.privacy-overlay[hidden]{
    display: none;
}

.privacy-box{
    width: 100%;
    max-width: 520px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(0,0,0,.28);
    overflow: hidden;
}

.privacy-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.privacy-head h2{
    margin: 0;
    font-family: "Koh Santepheap", serif;
    font-size: 22px;
    color: #880000;
}

.privacy-x{
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #880000;
    cursor: pointer;
}

.privacy-body{
    padding: 14px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: #444;
}

.privacy-body h3{
    margin: 18px 0 6px;
    font-family: "Koh Santepheap", serif;
    font-size: 15px;
    color: #880000;
}

.privacy-body p{ margin: 0 0 8px; }
.privacy-body ul{ margin: 0 0 8px; padding-left: 20px; }
.privacy-body li{ margin-bottom: 4px; }
.privacy-updated{ font-weight: 600; color: #880000; }

.privacy-foot{
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #eee;
}

.privacy-agree,
.privacy-cancel{
    flex: 1;
    height: 44px;
    border-radius: 14px;
    font-family: "Koh Santepheap", serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: .3s;
}

.privacy-agree{
    background: #880000;
    color: #fff;
    border: none;
}

.privacy-agree:hover{ background: #6f0000; }

.privacy-cancel{
    background: #fff;
    color: #880000;
    border: 1px solid #880000;
}
