:root {
    /* Brand & Accent Colors */
    --primary: #4A154B;
    --primary-hover: #3B113C;
    --primary-light: #F4EBF5;
    --primary-gradient: linear-gradient(135deg, #4A154B 0%, #6B21A8 100%);
    
    /* Global Background & Surface Colors */
    --bg-gradient: linear-gradient(135deg, #F9FAFB 0%, #F4EBF5 50%, #E9D5FF 100%);
    --surface-white: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --border-dark: #111827;
    --input-bg: #F9FAFB;
    
    /* Error & Alert Colors */
    --error-bg: #FEF2F2;
    --error-text: #DC2626;
    --error-border: #FCA5A5;

    /* Shadows & Radii */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(74, 21, 75, 0.12), 0 8px 10px -6px rgba(74, 21, 75, 0.08);
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Global Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    color: var(--text-main);
    position: relative;
    overflow-x: hidden;
}

/* Background Decorative Elements */
.bg-decoration {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

.bg-circle-1 {
    width: 340px;
    height: 340px;
    background: rgba(74, 21, 75, 0.12);
    top: -60px;
    right: -60px;
}

.bg-circle-2 {
    width: 400px;
    height: 400px;
    background: rgba(107, 33, 168, 0.10);
    bottom: -90px;
    left: -90px;
}

/* ==========================================================================
   1. LOGIN CARD & FORM
   ========================================================================== */

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--surface-white);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.brand-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Container for the logo */
.logo-badge {
    width: 150px;                  /* Increased from 64px */
    height: 150px;                 /* Increased from 64px */
    background: var(--surface-white); /* White background highlights logo transparently */
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 10px;                /* Gives breathing room around the logo */
    box-shadow: 0 4px 14px rgba(74, 21, 75, 0.12);
    transition: var(--transition);
}

/* Image inside the badge */
.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;          /* Preserves exact logo aspect ratio */
}

.login-card:hover .logo-badge {
    transform: scale(1.05) rotate(-3deg);
}

.logo-badge svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.brand-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
    margin-bottom: 0.375rem;
}

.brand-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.input-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.875rem;
    font-size: 0.95rem;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.form-input::placeholder {
    color: #9CA3AF;
}

.form-input:focus {
    background-color: var(--surface-white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(74, 21, 75, 0.12);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.btn-submit {
    margin-top: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--primary-gradient);
    color: var(--surface-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(74, 21, 75, 0.25);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(74, 21, 75, 0.35);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    background-color: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: center;
}

/* ==========================================================================
   2. OFFICIAL EXAMINATION SLIP VIEW
   ========================================================================== */

.results-container {
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    background: var(--surface-white);
    padding: 2.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    color: #000;
    font-family: Arial, sans-serif;
    position: relative;
    z-index: 1;
}

/* Action Bar Header */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-action {
    background-color: var(--primary);
    color: var(--surface-white);
    padding: 0.5rem 1.125rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: var(--transition);
}

.btn-action:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Header & Official College Branding */
.slip-header-title {
    text-align: center;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-dark);
    margin-bottom: 1rem;
}

.header-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.logo-cell {
    width: 180px;
    vertical-align: middle;
}

.logo-img {
    max-height: 55px;
    width: auto;
    display: block;
}

.college-info {
    font-size: 11px;
    line-height: 1.4;
    color: #000;
}

.college-name {
    font-weight: bold;
    font-size: 14px;
    color: var(--primary);
}

/* Student Information Table */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 12px;
}

.info-table td {
    padding: 6px 10px;
    border: 1px solid #d3d3d3;
}

.info-label {
    font-weight: bold;
    width: 15%;
    background-color: #f9fafb;
}

.info-val {
    width: 35%;
}

/* Semester Header Banner */
.semester-banner {
    border-top: 2px solid var(--border-dark);
    border-bottom: 2px solid var(--border-dark);
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    padding: 6px 0;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

/* Course Results Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-bottom: 1rem;
}

.results-table th, 
.results-table td {
    border: 1px solid #d3d3d3;
    padding: 7px 8px;
}

.results-table th {
    background-color: #f9fafb;
    font-weight: bold;
    text-align: center;
}

.results-table tbody tr:hover {
    background-color: #fdf8ff;
}

/* Summary & Status Table */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-top: 0.75rem;
}

.summary-table td {
    border: 1px solid #d3d3d3;
    padding: 6px 8px;
}

.summary-label {
    font-weight: bold;
    background-color: #f9fafb;
}

.status-badge {
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    margin-top: 1.25rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
    color: var(--primary);
}

.footer-note {
    font-style: italic;
    font-size: 10px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 1rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* ==========================================================================
   3. PRINT & MEDIA QUERIES
   ========================================================================== */

@media print {
    body { 
        background: #fff !important; 
        padding: 0 !important; 
    }
    .bg-decoration, 
    .action-bar, 
    .login-wrapper { 
        display: none !important; 
    }
    .results-container { 
        border: none !important; 
        box-shadow: none !important; 
        padding: 0 !important; 
        margin: 0 !important; 
        width: 100% !important; 
        max-width: 100% !important; 
    }
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }
    .results-container {
        padding: 1.25rem;
        overflow-x: auto;
    }
}