/* ========================================== */
/* 1. VARIABLE ROOT & BASE CONFIG             */
/* ========================================== */
:root {
    --brand-color: #6366f1;
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-soft: #f8fafc;
}

body {
    background-image: url('bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    padding: 0;
}

/* ========================================== */
/* 2. LAYOUT & BOX MAIN MAIN                  */
/* ========================================== */
.main-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: Inter, sans-serif;
    padding: 20px;
    box-sizing: border-box;
}

.login-box {
    background: #fff;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 7px 7px 0 #6366f1;
    border: 3px solid #6366f1;
    transition: transform 0.3s;
    animation: 0.6s ease-out fadeInUp;
    position: relative;
    box-sizing: border-box;
}

/* ========================================== */
/* 3. LOGIN HEADER & LOGO                     */
/* ========================================== */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.logo-icon {
    background: var(--brand-gradient);
    display: flex;
    width: 60px;
    height: 60px;
    color: #fff;
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

/* ========================================== */
/* 4. FORM ELEMENTS & INPUTS                  */
/* ========================================== */
.input-field {
    margin-bottom: 20px;
    text-align: left;
}

.input-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.input-field label i {
    margin-right: 4px;
    color: var(--brand-color);
}

.input-field input {
    width: 100%;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    transition: 0.2s;
    box-sizing: border-box;
}

.input-field input:focus {
    outline: 0;
    background: #fff;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-icon {
    position: absolute;
    right: 15px;
    cursor: pointer;
    z-index: 10;
    color: var(--text-muted);
    font-size: 14px;
}

/* ========================================== */
/* 5. BUTTONS STYLE                           */
/* ========================================== */
.btn-admin-submit,
.btn-role,
button {
    background: var(--brand-gradient);
    display: flex;
    width: 100%;
    padding: 14px;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
    margin-top: 10px;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-admin-submit:hover,
.btn-role:hover,
button:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ========================================== */
/* 6. MODALS & BACKDROP PANELS                */
/* ========================================== */
.custom-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.custom-modal {
    background: #fff;
    width: 100%;
    max-width: 400px;
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) popupShow;
    box-sizing: border-box;
}

.custom-modal h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px;
}

.custom-modal p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 24px;
    line-height: 1.5;
}

.role-container-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-role-choice {
    width: 100%;
    padding: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: 0.2s;
    background: #f1f5f9;
    color: var(--text-main);
}

.btn-role-choice:hover {
    background: #eff6ff;
    border-color: var(--brand-color);
    color: var(--brand-color);
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    flex: 1;
    background: #f1f5f9;
    color: var(--text-main);
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #000;
}

.btn-danger {
    flex: 1;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
    color: #fff;
}

/* ========================================== */
/* 7. FOOTER & MESSAGE SYSTEMS                */
/* ========================================== */
#message {
    margin-top: 20px;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
    font-weight: 500;
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
}

.login-footer p {
    margin: 4px 0 0 0;
}

/* ========================================== */
/* 8. PWA INSTALL BANNER CUSTOM SPECIFIC     */
/* ========================================== */
.pwa-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
    border: 2px solid var(--brand-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 9999;
    animation: fadeInUp 0.5s ease-out;
    box-sizing: border-box;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-banner-content i {
    font-size: 24px;
    color: var(--brand-color);
}

.pwa-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.pwa-text strong {
    font-size: 14px;
    color: var(--text-main);
}

.pwa-text span {
    font-size: 12px;
    color: var(--text-muted);
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-install {
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    margin: 0;
}

.btn-close-pwa {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 8px;
    font-size: 16px;
    cursor: pointer;
    width: auto;
    margin: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-pwa:hover {
    box-shadow: none;
    color: #ef4444;
    transform: none;
    opacity: 1;
}

/* ========================================== */
/* 9. MEDIA RESPONSIVE BREAKPOINTS            */
/* ========================================== */
@media (max-width: 768px) {
    .login-box {
        width: 100%;
        padding: 20px;
        border-radius: 24px;
        box-shadow: 5px 5px 0 #6366f1;
        border: 3px solid #6366f1;
    }
    .login-footer {
        margin-top: 32px;
        padding-top: 20px;
    }
}

@media (max-width: 420px) {
    .custom-modal, 
    .login-box {
        padding: 25px;
    }
}

/* ========================================== */
/* 10. ANIMATION KEYFRAMES                    */
/* ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popupShow {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}