@font-face {
    font-family: 'Aquarium Kulit';
    src: url('/fonts/aquarium.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: url('/image/x-icon/qrscanning2.jpg'); /* Added background image */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 0;
    position: relative;
    overflow-x: hidden;
    overflow-y: hidden;
}

/* Dark overlay with slightly different tone for admin */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 9, 17, 0.80); /* Slightly darker overlay for admin distinction */
    z-index: 0;
    pointer-events: none;
}

/* Decorative logo patterns - more subtle on dark background */
.bg-pattern {
    position: absolute;
    background-image: url('/image/x-icon/Smartlog-logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.06; /* More subtle on dark background */
    z-index: 1;
    filter: brightness(1.5); /* Brighten logos for visibility */
}

.bg-pattern-left {
    width: 450px;
    height: 450px;
    left: -180px;
    top: -20%;
}

.bg-pattern-right {
    width: 450px;
    height: 450px;
    right: -180px;
    top: 50%;
}

.bg-pattern-up {
    width: 200px;
    height: 200px;
    left: 60%;
    top: 40px;
}

.bg-pattern-down {
    width: 200px;
    height: 200px;
    left: 25%;
    bottom: 40px;
}

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 50px 45px;
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 2;
    border: 1px solid #e0e0e0;
}

.header {
    text-align: center;
    margin-bottom: 35px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.logo img {
    width: 45px;
    height: 45px;
    filter: drop-shadow(0 2px 4px rgba(107, 26, 44, 0.2));
}

.logo h1 {
    font-family: 'Aquarium Kulit', sans-serif;
    color:#6b1a2c; /* Changed to match main theme */
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px; /* Changed from 25px for consistency */
    font-size: 14px;
    transition: all 0.3s;
    background: #6b1a2c;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #6b1a2c; /* Changed to match theme */
}

input::placeholder {
    color: #bbb;
}

.login-btn {
    font-family: 'Tektur', Arial, sans-serif;
    width: 100%;
    padding: 14px;
    background: #6b1a2c; /* Changed to match theme */
    color: white;
    border: none;
    border-radius: 8px; /* Changed from 25px for consistency */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 25px;
    box-shadow: 0 2px 8px rgba(107, 26, 44, 0.2);
}

.login-btn:hover {
    background: #8c2340; /* Changed to match theme */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 26, 44, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.error-message.show {
    display: block;
}

input.error {
    border-color: #dc3545;
}

.success-message {
    background: #4caf50;
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-top: 15px;
    display: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.success-message.show {
    display: block;
}

.visitor-link {
    font-family: 'Aquarium Kulit', sans-serif;
    display: block;
    text-align: center;
    margin-top: 25px;
    color: #6b1a2c; /* Changed to match theme */
    text-decoration: underline;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.visitor-link:hover {
    color: #8c2340; /* Changed to match theme */
    transform: translateY(-1px);
}

/* Error and status message styling */
div[style*="color: red"] {
    background: #f8d7da;
    border: 1px solid #f5c6cb !important;
    color: #721c24 !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    font-size: 14px;
}

div[style*="color: green"] {
    background: #d4edda;
    border: 1px solid #c3e6cb !important;
    color: #155724 !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    font-size: 14px;
}

@media (max-width: 768px) {
    .bg-pattern {
        width: 150px;
        height: 150px;
        opacity: 0.04;
    }
    
    .bg-pattern-left {
        left: -50px;
        top: 10%;
    }
    
    .bg-pattern-right {
        right: -50px;
        top: 60%;
    }
    
    .bg-pattern-up {
        width: 100px;
        height: 100px;
        left: 70%;
    }
    
    .bg-pattern-down {
        width: 100px;
        height: 100px;
        left: 15%;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 40px 30px;
    }

    .logo h1 {
        font-size: 28px;
    }
    
    .logo img {
        width: 38px;
        height: 38px;
    }
    
    .bg-pattern {
        display: none;
    }
}

/* Responsive scaling for small heights */
@media (max-height: 700px) {
    .login-container {
        transform: scale(0.9);
        transform-origin: center center;
    }
    
    .bg-pattern {
        opacity: 0.03;
    }
}

@media (max-height: 500px) {
    .login-container {
        transform: scale(0.8);
        transform-origin: center center;
        padding: 35px 30px;
    }
}

@media (max-height: 400px) {
    .login-container {
        transform: scale(0.7);
        transform-origin: center center;
    }
}