* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e40af;
    --secondary-color: #0ea5e9;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f3f4f6;
    --border-color: #e5e7eb;
    --text-dark: #1f2937;
    --text-light: #6b7280;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-dark);
    min-height: 100vh;
}

/* LOGIN PAGE STYLES */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.portal-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 15px;
    animation: fadeIn 0.6s ease-out;
}

.portal-logo-header {
    max-width: 80px;
    height: auto;
    margin-right: 15px;
    vertical-align: middle;
}

.portal-title {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 700;
}

.portal-subtitle {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.error-message {
    display: block;
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 5px;
    min-height: 18px;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.message.error {
    display: block;
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.message.success {
    display: block;
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.help-section {
    margin-top: 20px;
    padding: 12px;
    background-color: var(--light-bg);
    border-radius: 8px;
}

.help-text {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

.footer-info {
    margin-top: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
}

/* RESULTS PAGE STYLES */
.results-container {
    min-height: 100vh;
    padding: 20px;
}

.results-header {
    background: white;
    border-radius: 12px;
    padding: 20px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background-color: #dc2626;
}

.loading-state,
.error-state {
    background: white;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-state p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 16px;
}

.results-content {
    animation: slideIn 0.5s ease-out;
}

.result-status-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-left: 5px solid var(--primary-color);
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 14px;
}

.status-badge.selected {
    background-color: #dcfce7;
    color: #15803d;
}

.status-badge.qualified {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.notqualified {
    background-color: #fee2e2;
    color: #dc2626;
}

.status-badge.absent {
    background-color: #fef3c7;
    color: #b45309;
}

.status-badge.pending {
    background-color: var(--light-bg);
    color: var(--text-light);
}

.result-status-card h2 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.final-result {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.results-main {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.result-section {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
}

.result-section:last-child {
    border-bottom: none;
}

.result-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
}

.result-grid,
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.result-item,
.info-item {
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.result-item label,
.info-item label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.result-item p,
.info-item p {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-word;
}

.address-box {
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    line-height: 1.6;
    color: var(--text-dark);
}

.remarks-box {
    padding: 15px;
    background-color: #fffbeb;
    border-left: 4px solid var(--warning-color);
    border-radius: 8px;
}

.remarks-text {
    color: #78350f;
    line-height: 1.6;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
    background-color: var(--light-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .results-header,
    .action-buttons,
    .btn-logout {
        display: none;
    }
    
    .results-container {
        padding: 0;
    }
    
    .results-content {
        box-shadow: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .portal-logo-header {
        max-width: 60px;
        margin-right: 0;
    }
    
    .result-section {
        padding: 20px;
    }
    
    .result-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .portal-title {
        font-size: 24px;
    }
    
    .portal-logo {
        max-width: 120px;
    }
}
