/**
 * Pambazuka Ministries Uganda System (PMUS)
 * Main Stylesheet - Professional Orange Theme
 * Developed by MusaNext Tech
 */

:root {
    /* Professional Orange Color Palette */
    --orange-primary: #FF6B35;
    --orange-dark: #E55A2B;
    --orange-light: #FF8A50;
    --orange-pale: #FFB090;
    --orange-accent: #F7931E;
    --orange-gradient: linear-gradient(135deg, #FF6B35 0%, #F7931E 50%, #FFB347 100%);
    
    /* Supporting Colors */
    --white: #FFFFFF;
    --gray-light: #F8F9FA;
    --gray-medium: #6C757D;
    --gray-dark: #343A40;
    
    /* Status Colors */
    --success: #28A745;
    --error: #DC3545;
    --warning: #FFC107;
    --info: #17A2B8;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --shadow-orange: 0 4px 20px rgba(255, 107, 53, 0.3);
    
    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* ==========================================================
   RESET & BASE STYLES
   ========================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-dark);
    background-color: var(--gray-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================
   LOGIN PAGE STYLES
   ========================================================== */
body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(120deg, #FF9F1C, #FFB347, #FFD07A);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatSoft {
    0% { transform: translateY(0px); opacity: 0.9; }
    50% { transform: translateY(-8px); opacity: 1; }
    100% { transform: translateY(0px); opacity: 0.9; }
}

.login-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(800px 800px at -10% -10%, rgba(255, 107, 53, 0.18), transparent 60%),
        radial-gradient(700px 700px at 110% 0%, rgba(247, 147, 30, 0.16), transparent 60%),
        radial-gradient(600px 600px at 50% 110%, rgba(255, 179, 71, 0.12), transparent 60%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease-in-out infinite;
    filter: saturate(110%);
}

.login-background::before,
.login-background::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    width: 220px;
    height: 220px;
    animation: floatSoft 6s ease-in-out infinite;
}

.login-background::before {
    top: 10%;
    left: 8%;
    filter: blur(2px);
}

.login-background::after {
    bottom: 12%;
    right: 10%;
    width: 260px;
    height: 260px;
    animation-delay: 1.5s;
    filter: blur(1px);
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
}

.login-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 2.25rem 2rem 1.5rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 0 0 0.5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 107, 53, 0.12);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.logo-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(180deg, #FFFFFF 0%, #FFF4EF 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 0.5px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    padding: 12px;
    overflow: hidden;
}

.logo-container:hover {
    transform: scale(1.02);
}

.logo-container i {
    font-size: 2.3rem;
    color: var(--orange-primary);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    z-index: 1;
}

.login-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
}

.logo-fallback {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    background: var(--orange-gradient);
    color: #fff;
    display: none;
}

.logo-fallback .monogram {
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 1px;
}

.login-header .tagline {
    font-size: 0.9375rem;
    color: #1D1D1F;
    font-weight: 600;
    margin-bottom: 0.375rem;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.login-header .subtitle {
    font-size: 0.8125rem;
    color: #86868B;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* Form Styles */
.login-form {
    margin-top: 0;
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-group:last-of-type {
    margin-bottom: 0;
}

.checkbox-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #1D1D1F;
    font-size: 0.8125rem;
    letter-spacing: -0.01em;
}

.form-group label i {
    margin-right: 8px;
    color: #86868B;
    font-size: 0.875rem;
    width: 16px;
    text-align: center;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #D2D2D7;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-family: var(--font-primary);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    background: #FFFFFF;
    color: #1D1D1F;
    box-shadow: none;
}

.form-control:hover {
    border-color: #86868B;
}

.form-control:focus {
    outline: none;
    border-color: var(--orange-primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.12);
    background: #FFFFFF;
}

.form-control::placeholder {
    color: #86868B;
    font-weight: 400;
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9A9A9A;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    transition: all 0.3s ease;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--orange-primary);
    background: rgba(255, 107, 53, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}


.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: #86868B;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    transition: color 0.2s ease;
    user-select: none;
}

.checkbox-label:hover {
    color: #1D1D1F;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #FF6B35;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked {
    box-shadow: none;
}

.btn-login {
    width: 100%;
    padding: 12px 22px;
    background: var(--orange-gradient);
    border: none;
    border-radius: 12px;
    color: #FFFFFF;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
    box-shadow: none;
    position: relative;
    overflow: visible;
    letter-spacing: -0.01em;
    font-size: 0.9375rem;
}

.btn-login:hover {
    background: linear-gradient(135deg, #FF6B35 0%, #E55A2B 50%, #F7931E 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-login:active {
    transform: translateY(0);
    background: #D95022;
}

.btn-login span,
.btn-login i {
    position: relative;
    z-index: 1;
}

.btn-login i {
    transition: transform 0.2s ease;
    font-size: 0.875rem;
}

.btn-login:hover i {
    transform: translateX(2px);
}

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 3px solid;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.alert i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.alert span {
    line-height: 1.5;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: var(--error);
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: var(--success);
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    border: 1px solid rgba(23, 162, 184, 0.3);
    color: var(--info);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: var(--warning);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 0.5px solid #D2D2D7;
    color: #86868B;
    font-size: 0.75rem;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.login-footer p {
    margin: 2px 0;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.login-footer p:first-child {
    margin-bottom: 3px;
    color: #86868B;
}

.login-footer strong {
    color: #1D1D1F;
    font-weight: 600;
}

/* Site footer at the bottom of the viewport on login page */
.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 6px 8px;
    font-size: 0.8rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.08);
    z-index: 20;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    body.login-page,
    .login-background {
        animation: none !important;
    }
    .login-card {
        animation: none !important;
    }
    .logo-container,
    .toggle-password:hover {
        transform: none !important;
    }
}

/* Unauthorized Page */
body.unauthorized-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--orange-gradient);
}

.unauthorized-container {
    width: 100%;
    max-width: 500px;
    padding: var(--spacing-md);
}

.unauthorized-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: var(--spacing-xl);
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.unauthorized-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--spacing-md);
    background: rgba(220, 53, 69, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unauthorized-icon i {
    font-size: 3rem;
    color: var(--error);
}

.unauthorized-card h1 {
    color: var(--gray-dark);
    margin-bottom: var(--spacing-sm);
}

.unauthorized-card p {
    color: var(--gray-medium);
    margin-bottom: var(--spacing-xs);
}

.unauthorized-card .sub-message {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-lg);
}

.btn-home {
    display: inline-block;
    padding: 12px 30px;
    background: var(--orange-gradient);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: var(--shadow-orange);
}

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.4);
    color: white;
}

/* Responsive */
@media (max-width: 640px) {
    body.login-page {
        padding: 10px;
    }
    
    .login-container {
        max-width: 100%;
        min-height: auto;
    }
    
    .login-card {
        padding: 1.75rem 1.5rem 1.5rem;
        border-radius: 20px;
    }
    
    .login-header {
        margin-bottom: 1.25rem;
    }
    
    .login-header .tagline {
        font-size: 0.8rem;
    }
    
    .login-header .subtitle {
        font-size: 0.75rem;
    }
    
    .logo-container {
        width: 70px;
        height: 70px;
        margin-bottom: 0.875rem;
    }
    
    .logo-container i {
        font-size: 2rem;
    }
    
    .form-group {
        margin-bottom: 0.9rem;
    }
    
    .form-control {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
    
    .checkbox-group {
        margin-bottom: 1rem;
    }
    
    .btn-login {
        padding: 13px 20px;
        margin-top: 1rem;
        font-size: 0.8rem;
    }
    
    .login-footer {
        margin-top: 1.25rem;
        padding-top: 0.875rem;
        font-size: 0.7rem;
    }
    
    .alert {
        padding: 10px 14px;
        margin-bottom: 0.875rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    body.login-page {
        padding: 8px;
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .login-container {
        max-width: 100%;
    }
    
    .login-card {
        padding: 1.5rem 1.25rem 1.25rem;
        border-radius: 18px;
    }
    
    .login-header {
        margin-bottom: 1.125rem;
    }
    
    .login-header h1 {
        font-size: 1.45rem;
    }
    
    .login-header .tagline {
        font-size: 0.775rem;
    }
    
    .login-header .subtitle {
        font-size: 0.7rem;
    }
    
    .logo-container {
        width: 65px;
        height: 65px;
        margin-bottom: 0.75rem;
    }
    
    .logo-container i {
        font-size: 1.8rem;
    }
    
    .form-group {
        margin-bottom: 0.875rem;
    }
    
    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .form-control {
        padding: 11px 13px;
        font-size: 0.875rem;
    }
    
    .checkbox-group {
        margin-bottom: 0.875rem;
    }
    
    .checkbox-label {
        font-size: 0.8rem;
        padding: 6px;
    }
    
    .btn-login {
        padding: 12px 18px;
        font-size: 0.775rem;
        margin-top: 0.875rem;
    }
    
    .login-footer {
        margin-top: 1rem;
        padding-top: 0.75rem;
        font-size: 0.65rem;
    }
    
    .login-footer p {
        margin: 2px 0;
    }
    
    .alert {
        padding: 10px 12px;
        font-size: 0.775rem;
        margin-bottom: 0.875rem;
    }
}

@media (max-width: 360px) {
    body.login-page {
        padding: 5px;
        padding-top: 15px;
        padding-bottom: 15px;
    }
    
    .login-card {
        padding: 1.25rem 1rem 1rem;
    }
    
    .login-header h1 {
        font-size: 1.3rem;
    }
    
    .logo-container {
        width: 60px;
        height: 60px;
    }
    
    .logo-container i {
        font-size: 1.6rem;
    }
}
