/* ===================================================
   APERSI Housing Management - Login Page Stylesheet
   Primary: #1a3c6e | #2563eb | #3b82f6
   =================================================== */

/* ===== ROOT ===== */
:root {
    --primary-dark:    #1a3c6e;
    --primary-mid:     #2563eb;
    --primary-light:   #3b82f6;
    --primary-lighter: #60a5fa;
    --font-family:     'Poppins', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background: #f0f4f8;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
}

/* ===== BACKGROUND DECORATION ===== */
.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-decoration::before {
    content: '';
    position: absolute;
    top: -120px;
    left: -120px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37,99,235,0.12) 0%, transparent 70%);
    border-radius: 50%;
}

.bg-decoration::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(26,60,110,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.bg-blob-1 {
    position: absolute;
    top: 30%;
    right: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(96,165,250,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.bg-blob-2 {
    position: absolute;
    bottom: 20%;
    left: -60px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(37,99,235,0.07) 0%, transparent 70%);
    border-radius: 50%;
}

/* ===== MAIN WRAPPER ===== */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    padding: 20px 16px;
}

/* ===== CARD ===== */
.login-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.12), 0 4px 20px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* ===== CARD HEADER ===== */
.login-header {
    background: linear-gradient(160deg, #1a3c6e 0%, #1e4d8c 40%, #2563eb 100%);
    padding: 36px 40px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 180px;
    height: 180px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.login-header::after {
    content: '';
    position: absolute;
    bottom: -70px;
    left: -30px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.login-logo {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
}

.login-logo i {
    font-size: 1.8rem;
    color: #fff;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.login-header p {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* ===== CARD BODY ===== */
.login-body {
    padding: 36px 40px 40px;
}

.login-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.login-desc {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 28px;
}

/* ===== FORM ===== */
.form-label-custom {
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    display: block;
    letter-spacing: 0.3px;
}

.input-group-custom {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    z-index: 2;
    pointer-events: none;
    transition: color 0.2s;
}

.form-control-custom {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: #1e293b;
    background: #f8faff;
    transition: all 0.2s;
    outline: none;
}

.form-control-custom:focus {
    border-color: var(--primary-mid);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.form-control-custom::placeholder {
    color: #cbd5e1;
    font-size: 0.83rem;
}

.form-control-custom:focus + .input-icon,
.input-group-custom:focus-within .input-icon {
    color: var(--primary-mid);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    z-index: 2;
    transition: color 0.2s;
}

.password-toggle:hover { color: var(--primary-mid); }

.form-control-password {
    padding-right: 44px;
}

/* ===== REMEMBER & FORGOT ===== */
.form-check-custom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-custom input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--primary-mid);
}

.form-check-custom label {
    font-size: 0.78rem;
    color: #64748b;
    cursor: pointer;
    font-weight: 500;
}

.forgot-link {
    font-size: 0.78rem;
    color: var(--primary-mid);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-link:hover { color: var(--primary-dark); }

/* ===== SUBMIT BUTTON ===== */
.btn-login {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.btn-login:hover {
    background: linear-gradient(135deg, #1d4ed8, #1a3c6e);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== ROLE BADGES ===== */
.role-hint {
    background: #f8faff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
}

.role-hint-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.role-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}

.role-item:last-child { border-bottom: none; }

.role-item:hover { background: rgba(37,99,235,0.03); }

.role-badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    min-width: 72px;
    text-align: center;
}

.role-badge.admin     { background: rgba(37,99,235,0.1);  color: #2563eb; }
.role-badge.developer { background: rgba(16,185,129,0.1); color: #059669; }
.role-badge.user      { background: rgba(245,158,11,0.1); color: #d97706; }

.role-email {
    font-size: 0.75rem;
    color: #475569;
    font-weight: 500;
}

.role-pass {
    margin-left: auto;
    font-size: 0.7rem;
    color: #94a3b8;
    font-family: monospace;
}

/* ===== ALERT ===== */
.alert-custom {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.alert-danger-custom {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    color: #dc2626;
}

.alert-success-custom {
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    color: #059669;
}

/* ===== FOOTER ===== */
.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.72rem;
    color: #94a3b8;
}

.login-footer a {
    color: var(--primary-mid);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    color: var(--primary-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .login-header { padding: 28px 24px 24px; }
    .login-body   { padding: 28px 24px 32px; }
}

@media (max-width: 360px) {
    .login-wrapper {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .login-body {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .login-subtitle {
        font-size: 0.8rem;
    }
    
    .login-desc {
        font-size: 0.75rem;
    }
    
    .form-label-custom {
        font-size: 0.75rem;
    }
    
    .form-control-custom {
        padding: 10px 12px 10px 38px;
    }
}
