﻿body.page-login {
    overflow: hidden;
}

.login-bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/user/bg-login.jpg') no-repeat center center;
    background-size: cover;
    z-index: -2;
}

.lantern-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* Main Container - Desktop */
.login-page-container {
    height: calc(100vh - 100px);
    /* Tweak height */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center horizontally */
    position: relative;
    z-index: 10;
    padding: 0 5%;
}

/* Login Card - Desktop */
.login-card {
    background: rgba(13, 17, 23, 0.6);
    /* Slightly darker for better contrast */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 40px 50px;
    width: 100%;
    max-width: 480px;
    margin-left: 20%;
    /* Offset to the right to balance character on left */
    margin-top: -50px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

/* Character Layer - Desktop */
.login-char-layer {
    position: fixed;
    bottom: 0px;
    left: 0px;
    width: 70vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    background-image: url('assets/images/char_doctor_action.png');
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: auto 85%;
    mix-blend-mode: screen;
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 60%, transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 60%, transparent 100%);
    filter: contrast(1.1) brightness(1.2);
    animation: charFadeIn 1s ease-out;
}

/* Responsive Mobile (< 900px) - ONLY HERE */
@media (max-width: 900px) {

    /* Container: Center */
    .login-page-container {
        justify-content: center;
        align-items: center;
        padding: 20px;
        height: 100vh;
        min-height: 600px;
        display: flex;
        margin-top: -60px;
    }

    /* Card: Compact */
    .login-card {
        margin: 0;
        width: 100%;
        max-width: 360px;
        background: rgba(13, 17, 23, 0.95);
        padding: 25px 25px;
        border-radius: 16px;
    }

    /* Hide Breadcrumbs ONLY on Mobile */
    .breadcrumbs-container,
    .breadcrumbs,
    ul.breadcrumbs,
    nav.breadcrumbs,
    .breadcrumb {
        display: none !important;
        visibility: hidden !important;
    }

    .login-title {
        margin-bottom: 25px;
    }

        .login-title h1 {
            font-size: 24px;
            margin-bottom: 0px;
        }

        .login-title p {
            display: none;
        }

    .form-group {
        margin-bottom: 15px;
    }

    .input-box input {
        padding: 12px 15px 12px 45px;
        font-size: 15px;
        height: 45px;
    }

    .captcha-row {
        margin-bottom: 20px;
    }

    .captcha-img {
        height: 45px;
    }

    .btn-login-submit {
        padding: 12px;
        font-size: 16px;
        margin-top: 5px;
    }

    .login-char-layer {
        opacity: 0.15;
        mix-blend-mode: normal;
        mask-image: none;
        background-size: cover;
        background-position: center;
    }
}

@keyframes charFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Elements Styling (Desktop Default) */
.login-title h1 {
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(245, 158, 11, 0.5);
}

.login-title p {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 5px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 8px;
    font-weight: 600;
}

.input-box {
    position: relative;
}

    .input-box input {
        width: 100%;
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        padding-left: 45px;
        /* ใส่กลับมา */
        padding-right: 15px;
        padding-top: 12px;
        padding-bottom: 12px;
        color: #fff;
        font-size: 15px;
        transition: 0.3s;
    }

        .input-box input:focus {
            color: #ffffff;
            background: rgba(0, 0, 0, 0.6);
            border-color: #f59e0b;
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
            outline: none;
        }

    .input-box i {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: #64748b;
        font-size: 16px;
        transition: 0.3s;
    }

    .input-box input:focus + i {
        color: #f59e0b;
    }

.captcha-row {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.captcha-img {
    flex: 1;
    height: 45px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

    .captcha-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.captcha-input {
    width: 100px;
    text-align: center;
    letter-spacing: 2px;
    font-weight: bold;
    font-size: 16px;
}

.btn-login-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

    .btn-login-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
    }

.form-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

    .form-footer a {
        color: #94a3b8;
        text-decoration: none;
        transition: 0.2s;
    }

        .form-footer a:hover {
            color: #f59e0b;
        }

.security-notice {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Modal Styles */
.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s;
}

    .custom-modal-overlay.active {
        display: flex;
        opacity: 1;
    }

.pin-modal-card {
    background: #111827;
    border: 1px solid #f59e0b;
    border-radius: 16px;
    padding: 30px;
    width: 320px;
    text-align: center;
    transform: scale(0.9);
    transition: 0.3s;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.2);
}

.custom-modal-overlay.active .pin-modal-card {
    transform: scale(1);
}

.pin-display {
    font-size: 32px;
    letter-spacing: 8px;
    color: #f59e0b;
    margin: 20px 0;
    height: 50px;
    line-height: 50px;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.key-btn {
    background: #1f2937;
    border: 1px solid #374151;
    color: #fff;
    font-size: 20px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

    .key-btn:hover {
        background: #f59e0b;
        color: #000;
        border-color: #f59e0b;
    }

.pin-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.btn-clear {
    background: #374151;
    color: #fff;
}

.btn-cancel {
    background: #ef4444;
    color: #fff;
}
