/* CSS Reset & Variables */
:root {
    /* Brand Colors based on Logo */
    --brand-blue: #1C5D99;
    /* Deep Blue from logo ring */
    --brand-light-blue: #639FAB;
    /* Lighter blue from water */
    --brand-green: #568203;
    /* Green from hills */
    --brand-yellow: #FFC72C;
    /* Yellow from sun/field */

    /* UI System Colors */
    --primary: var(--brand-blue);
    --primary-hover: #154a7c;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-page: #f3f4f6;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --input-bg: #f9fafb;
    --focus-ring: rgba(28, 93, 153, 0.25);

    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;

    /* Spacing & Radius */
    --radius-lg: 1rem;
    --radius-md: 0.5rem;
    --radius-sm: 0.375rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #e0e7ff 0%, #f0fdf4 100%);
    /* Soft Blue to Green gradient base */
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Background Art */
.login-bg-art {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    /* Removed solid background to let body gradient show */
}

/* Abstract Background Shapes - Performance Optimized */
.circle {
    position: absolute;
    border-radius: 50%;
    /* OPTIMIZED: Lighter blur + hardware acceleration */
    filter: blur(20px);
    opacity: 0.7;
    z-index: 1;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.circle-1 {
    width: 100vw;
    height: 100vw;
    background: radial-gradient(circle, rgba(99, 159, 171, 0.3) 0%, rgba(99, 159, 171, 0) 70%);
    top: -50vw;
    left: -20vw;
    animation: pulseGlow 20s infinite alternate ease-in-out;
}

.circle-2 {
    width: 100vw;
    height: 100vw;
    background: radial-gradient(circle, rgba(28, 93, 153, 0.25) 0%, rgba(28, 93, 153, 0) 70%);
    bottom: -50vw;
    right: -20vw;
    animation: pulseGlow 25s infinite alternate-reverse ease-in-out;
}

/* Added a 3rd filler shape for the center/voids */
.circle-4 {
    position: absolute;
    width: 120vw;
    height: 120vw;
    background: radial-gradient(circle, rgba(235, 245, 255, 0.6) 0%, rgba(235, 245, 255, 0) 60%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translate3d(0, 0, 0);
    z-index: 0;
}

@keyframes pulseGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(5%, 5%) scale(1.02);
    }
}

/* Entry Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes staggerReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    z-index: 10;
    /* Animation applied here */
    animation: scaleIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    /* Increased blur for premium feel */
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.05),
        0 20px 25px -5px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 25px -5px rgba(0, 0, 0, 0.05),
        0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Brand Header */
.brand-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    width: 100px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.brand-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-blue);
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

.brand-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s;
}

.input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    /* Left padding for icon */
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    font-family: inherit;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.input-wrapper input:focus+.input-icon,
.input-wrapper input:focus~.input-icon {
    color: var(--primary);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-main);
}

/* Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    font-size: 0.875rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s;
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Button */
.btn-login {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(28, 93, 153, 0.2);
}

.btn-login:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(28, 93, 153, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login svg {
    transition: transform 0.2s;
}

.btn-login:hover svg {
    transform: translateX(4px);
}

/* Footer */
.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }
}

/* =========================================
   DASHBOARD STYLES
   ========================================= */

body.dashboard-body {
    display: block;
    /* Override flex center from login */
    height: auto;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* Dashboard Animation Circle Extra defined in main background section now */

/* Navbar */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    width: 48px;
    height: auto;
}

.nav-title h1 {
    font-size: 1.25rem;
    line-height: 1.2;
    color: var(--brand-blue);
}

.nav-title span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
    display: none;
}

@media (min-width: 768px) {
    .user-info {
        display: block;
    }
}

.user-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-logout {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Dashboard Content */
.dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.welcome-banner {
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.welcome-banner h2 {
    font-size: 2rem;
    color: var(--brand-blue);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-banner p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.module-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    /* Better blur */
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    /* Slightly rounder */
    padding: 2.5rem;
    /* More breathing room */
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 260px;

    /* Staggered Animation Defaults */
    opacity: 0;
    transform: translateY(20px);
    animation: staggerReveal 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Stagger delays for cards */
.module-card:nth-child(1) {
    animation-delay: 0.1s;
}

.module-card:nth-child(2) {
    animation-delay: 0.2s;
}

.module-card:nth-child(3) {
    animation-delay: 0.3s;
}

.module-card:nth-child(4) {
    animation-delay: 0.4s;
}

.module-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow:
        0 25px 30px -5px rgba(0, 0, 0, 0.1),
        0 15px 15px -5px rgba(0, 0, 0, 0.05);
    background: #fff;
    border-color: #fff;
}

/* Card Badge/Accent Styles */
.card-blue {
    border-top: 4px solid var(--brand-blue);
}

.card-green {
    border-top: 4px solid var(--brand-green);
}

.card-yellow {
    border-top: 4px solid var(--brand-yellow);
}

.card-purple {
    border-top: 4px solid #8b5cf6;
}

/* Example accent for inventory */

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.module-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Icon Colors */
.card-blue .card-icon {
    background: rgba(28, 93, 153, 0.1);
    color: var(--brand-blue);
}

.card-green .card-icon {
    background: rgba(86, 130, 3, 0.1);
    color: var(--brand-green);
}

.card-yellow .card-icon {
    background: rgba(255, 199, 44, 0.15);
    color: #d9a406;
}

/* Darker yellow for text visibility */
.card-purple .card-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.card-info {
    flex: 1;
}

.card-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.card-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.card-action {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: gap 0.2s ease;
}

.card-blue .card-action {
    color: var(--brand-blue);
}

.card-green .card-action {
    color: var(--brand-green);
}

.card-yellow .card-action {
    color: #d9a406;
}

.card-purple .card-action {
    color: #8b5cf6;
}

.module-card:hover .card-action {
    gap: 0.75rem;
}